Workstation discovery - all installed printers

jraiburn
Kilo Contributor

We have a requirement to get ALL of the installed printers from a machine.  In debugging the Windows OS - Desktop processes we can see that it is only finding the local printers and not the mapped network printers.  Has anyone ran into this and found a solution?

1 REPLY 1

Fabian Kunzke
Kilo Sage
Kilo Sage

Hello,

With WMI (which is what ServiceNow uses to determine the printers) you will only get local printers. I did some digging and it basically seems to come down to one option:

You will need to use winRM to execute a powershell command on the host "Get-Printer" (link to the microsoft examples).

This should give you a full list of all printers.

You can make this more elaborate by following this thread here and include all registered printers under all user contexts. However, you may need to fiddle around with your credentials to have access to the user contexts and their registry files.

tl:dr: With WMI and the WIN_32 Printer call you are somewhat limited.

Hope this helps.

Regards

Fabian