Powershell or WMI to pull Printer Properties and Additional Drivers?

Posted by JeremiahJohnson on Server Fault See other posts from Server Fault or by JeremiahJohnson
Published on 2012-05-31T18:33:14Z Indexed on 2012/11/21 5:04 UTC
Read the original article Hit count: 703

What I am trying to accomplish:

Use a powershell script (WMI or cmdlets directly, or a combination) to query a 2003 or 2008 server with the PrintServer role, enumerate the printers shared, then list the drivers in use for that printer and specifically if an x86 or x64 driver is being used (or both).

I've looked at Win32_Printer, Win32_PrinterDriver, Get-Printer, etc. None of these seem to be able to tell me about x64 drivers or when multiple platform-specific drivers are loaded. Something like:

gwmi win32_printer -computername lebowski | %{$name = $_.name
$supported = $_.getrelated('Win32_PrinterDriver') | select supportedplatform, driverpath, version
Write-Host $name
return $supported 
} 

Produces the following:

PCLOADLETTER
supportedplatform : Windows NT x86
driverpath        : C:\WINDOWS\system32\spool\DRIVERS\W32X86\3\RIC54Dc.DLL
version           : 3

However the problem being that particular printer also has x64 drivers loaded. I really don't want to manually check the properties tab of 100 printers just to see if they have the x64 driver loaded.

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about scripting