Is there any powershell command to get the port IP address for a printer RRS feed

  • Question

  • Is there any powershell command to get the port IP address for a printer. Get-printer will give me the port name but not the IUP address which over time has become different on many of ours.


    Friday, September 6, 2019 2:50 PM

All replies

  • help Get-PrinterPort -full


    Friday, September 6, 2019 3:42 PM
  • I need to be able to get the printer port IP of a specific printer or one ata  time.

    For example this one will get me the Port Name of a specific printer but not the IP address of the port.

    Get-Printer -name "arth-208-1nb" | select-object -ExpandProperty portname


    Friday, September 6, 2019 4:01 PM
  • Did you actually read the help?  Did you try the command? Did you look at how it works and what it returns?

    The command does exactly what you ask.

    Get-Printer | select name,portname

    Get-PrinterPort | select name


    Friday, September 6, 2019 4:43 PM
  • Get-PrinterPort | select name gives me a list pf all of them I was looking for a way to get the port  Ip address of either a specific printer or a list of IP per printer


    Monday, September 9, 2019 7:14 PM
  • You have to combine the portname from the printer with the Het-Printerport command to get the port.

    Only directly connected printers with "Standard TcpIp" ports have an IP.

    $portname = Get-Printer "printer name" | select -expand portname
    Get-PrinterPort $portname


    Monday, September 9, 2019 7:18 PM
  • this $portname = Get-Printer "printer name" | select -expand portname gives me this error. It doesn;t recognize printer name

    Get-Printer : No MSFT_Printer objects found with property 'Name' equal to 'printer name'.  Verify the value of the
    property and retry.
    At line:1 char:13
    + $portname = Get-Printer "printer name" | select -expand portname
    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (printer name:String) [Get-Printer], CimJobException
        + FullyQualifiedErrorId : CmdletizationQuery_NotFound_Name,Get-Printer


    Monday, September 9, 2019 8:36 PM
  • First learn basic PowerShell then use PowerShell help on all commands that you wish to use.

    help Get-Printer -online

    We cannot teach you basic PowerShell.   Learning that is your responsibility.


    Monday, September 9, 2019 8:38 PM
  • Please refrain for using personal attacks and profanity or your account may be suspended.


    Monday, September 9, 2019 9:34 PM
  • Ummm . . . I'm pretty sure he means that you should supply the name of the printer you're working on -- unless you have a printer that's literally named "printer name"!

    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Monday, September 9, 2019 9:35 PM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Just do it.

    Friday, October 4, 2019 8:27 AM