When I use the following Powershell command to list all the printers my laptop has configured, it takes a few minutes for Windows to return the result. I have 3 printers configured, one is a virtual CutePDF printer, one is a Canon printer on my home network and the last is a Xerox printer on my work network.

I am currently using the following to list the printers

gwmi -class Win32_Printer -computer .

Are there faster ways to do this? What's causing the slow down, is it interrogating the network for print server?

  • 1
    I'm guessing it's trying to query the work printer and timing out eventually. On my computer that only has local and home network printers configured, the same command takes only 1-2 seconds. – Indrek Nov 30 '12 at 11:15
  • That's my thought as well. I would think there would be some way to specify a timeout or have a little more control over the way you query for it. I guess I could go directly against the registry. – Johnnie Nov 30 '12 at 18:47
  • 1
    I found a PS function that wraps Get-WmiObject and allows you to specify the timeout: muscetta.com/2009/05/27/get-wmicustom. See if that fixes your problem. – Indrek Nov 30 '12 at 20:18

There is no workaround, since the Win32_Printer is the OS object.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.