Print Test Page on a specific printer

Welcome Forums General PowerShell Q&A Print Test Page on a specific printer

This topic contains 3 replies, has 3 voices, and was last updated by

Ron
 
Participant
1 year, 1 month ago.

  • Author
    Posts
  • #85372

    Participant
    Points: 1
    Rank: Member

    Hello,

    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 {$_.name -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!

  • #85373
    Jon

    Participant
    Points: 53
    Rank: Member
  • #86911

    Participant
    Points: 1
    Rank: Member

    Hello,

    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 🙁

    Thank you

  • #86977
    Ron

    Participant
    Points: 2
    Rank: Member

    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
    $p[0].printtestpage()

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

The topic ‘Print Test Page on a specific printer’ is closed to new replies.