PowerTip: Find Printer Ports by Using PowerShell


Summary:  Use Windows PowerShell to find printer ports. 

Hey, Scripting Guy! Question How can I use a Windows PowerShell function to enumerate printer ports on my system?

Hey, Scripting Guy! Answer Use the Get-PrinterPort function. By default, it returns all local printer ports.

Comments (3)

  1. Greg Wojan says:

    And only Windows 8+.

  2. MNscripter says:

    @glauber, Get-PrinterPort is a ver 3.0+ cmdlet.

  3. glauber ribeiro says:

    The output is not very helpful:

    PS > get-printerport
    get-printerport : The term ‘get-printerport’ is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.
    At line:1 char:1
    + get-printerport
    + ~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (get-printerport:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Skip to main content