Print Test Page on a specific printer


I would like to be able to print a testpage on a given system.

So far I have this one-liner:

(Get-WmiObject win32_printer -ComputerName | where {$ -eq “”}).printTestPage()

this doesn’t create an error and I can see in the printer queue that something comes in, is being spooled and then leaves the queue.

The only problem is, that nothing is coming out of the printer. I’m ruling out a printer issue since printing the test page via the GUI works fine.

Thank you for your help!


thank you for the link.

Unfortunately I can only work with PowerShell 2 on this machine…

Therefore CIM is not an option.

I still dont understand why my WMI command doesn’t work. Since it is spooling, but physically nothing comes out of the printer :frowning:

Thank you

The method you used worked for me, however, there were some differences in execution. I collected local printers into an array, then called the method on the one I wanted to test, which was a virtual printer (Print to One Note).

$p= Get-WmiObject win32_printer

So, in theory at least, your method should work. Try breaking it down into smaller steps and confirm each one.