How to check IP address of configured network printer with command line

… and now the question comes to mind, why would you need to do so? huh?
Here’s why. You need to check printer details on remote host and the only access you have to this machine is CMD via PSExec.
You need to know this IP address, but the printer is now offline and it doesn’t appear in arp -a or net view … as it’s switched off, in other words, is not visible on the network.  Could not be any worse :)

so … psexec to remote host by opening CMD then psexec.exe \\remotehost cmd, this will open CMD on the remote host machine.

to make sure that the remote machine you are connecting to has the printer added, you can execute wmi W32_Printer class based command to list configured printers. To read more about Windows Management Instrumentation click here

To do so: Open CMD, type wmic . Command will return with  wmic:root\cli>

Type there in /node:remotehost printerconfig  and it will return with something similar to this:

so, back to CMD, press Ctrl+C to exit WMI console.

browse in CMD to the following location :

then execute the following script: cscript prnmngr.vbs -l  – this will list all configured printers including the one you are looking for (ie. HP from above screenshot).

here you go, your port name is your printer IP.

Leave a Reply

Your email address will not be published. Required fields are marked *