Powershell or WMI to pull Printer Properties and Additional Drivers?
- by JeremiahJohnson
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.