How to get printer IP address via command line?

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

Hello:

Another question for you printer experts out there! ;-)

We have several networked printers on the system and I'm trying to find a
way to get their IP addresses via a command (DOS) line command. Like Ping
for example. I was told that should work and it does if I ping the actual
IP address. But if I ping the printer's "name" in the system, it doesn't
work.

I get the following message (PR34 is the printer's name):

"Ping reqeust could not find host PR34. Please check the name and try
again."

I need a way to get the IP address from the "name" of the printer if that's
even possible. I know someone who can do this with their printer on their
network, but not sure why it's not working on ours.

Thx in advance, JJ
 
Hello:

Another question for you printer experts out there! ;-)

We have several networked printers on the system and I'm trying to find a
way to get their IP addresses via a command (DOS) line command. Like Ping
for example. I was told that should work and it does if I ping the actual
IP address. But if I ping the printer's "name" in the system, it doesn't
work.

I get the following message (PR34 is the printer's name):

"Ping reqeust could not find host PR34. Please check the name and try
again."

I need a way to get the IP address from the "name" of the printer if that's
even possible. I know someone who can do this with their printer on their
network, but not sure why it's not working on ours.

Thx in advance, JJ

nslookup printername

include the whole domain name if not set as the default on your
system.
 
nslookup printername

include the whole domain name if not set as the default on your
system.

Thanks, I should have mentioned that I tried that command. It does return
an IP but not the right one. When I then take that IP and enter into a
browser, it doesn't connect to the printer. When I look at Control Panel,
Printers..., select the printer, look at Properties, Port, Config Port...the
IP address there is different.

Why would that be do you know? That IP address *will* work in a browser,
bringing up the printer's browser based command screen. That's what I'm
trying to get at, *that* IP address...

Odd. Thx, JJ
 
Thanks, I should have mentioned that I tried that command. It does return
an IP but not the right one. When I then take that IP and enter into a
browser, it doesn't connect to the printer. When I look at Control Panel,
Printers..., select the printer, look at Properties, Port, Config Port...the
IP address there is different.

Why would that be do you know? That IP address *will* work in a browser,
bringing up the printer's browser based command screen. That's what I'm
trying to get at, *that* IP address...

Odd. Thx, JJ

I would think this points to DNS/host table issues since nslookup is
going to get it's info from here. If the name has the incorrect IP
address associated with it then that's a real problem. What method is
used to assign IP addresses on your network?

I'm quickly coming to the limits of my knowledge here.
 
I suspect the printers haven't been put into DNS at all.

Look at the reply to my suggestion. nslookup gets an IP address that
appears to be different from the one the PC has for the port connected
to this printer. Something is not right in Denmark?
 
Look at the reply to my suggestion. nslookup gets an IP address that
appears to be different from the one the PC has for the port connected
to this printer. Something is not right in Denmark?

You wonder if the network has a series of computers with names and IPs in
DNS. And each printer attached to a computer has been given the (Windows
network) name of that computer, which is in a different namespace and
doesn't have a domain part.

It would be interesting to do a reverse lookup on that IP address (the
real one) to see if it has any kind of name associated with it.
 
me said:
I would think this points to DNS/host table issues since nslookup is
going to get it's info from here. If the name has the incorrect IP
address associated with it then that's a real problem. What method is
used to assign IP addresses on your network?

I'm quickly coming to the limits of my knowledge here.

Well, you are w-a-y beyond my limited knowledge here! :-) The printer
works fine and is accessible from many systems...I don't know how the IP was
assigned. I'll have to ask the network folks. They, so far, have also been
unable to help me do this...but it what it is. Thx again! JJ
 
Bob Eager said:
You wonder if the network has a series of computers with names and IPs in
DNS. And each printer attached to a computer has been given the (Windows
network) name of that computer, which is in a different namespace and
doesn't have a domain part.

It would be interesting to do a reverse lookup on that IP address (the
real one) to see if it has any kind of name associated with it.

I'm not sure how to do this...and I'm confused now! Very easy to to for me
with this network stuff! ;-) It's odd for sure. I appreciate the input
from everyone. JJ
 
JJ said:
We have several networked printers on the system and I'm trying to find a
way to get their IP addresses via a command (DOS) line command. Like Ping
for example. I was told that should work and it does if I ping the actual
IP address. But if I ping the printer's "name" in the system, it doesn't
work.

JJ-

Some installations use printer servers. Your computer sends a print job
to the server, where it is placed in the print queue. The server sends
each print job in the queue on to the printer, one at a time in the
order they were received.

When you attempt to find the printer's IP address, you may actually be
getting the IP address of the server. If that is the case, one way you
can find the IP address of a printer is from the printer's control panel
as has been suggested. Otherwise, you would need to access the server's
setup program to see the IP address where each printer name is routed.
Unless you are the boss, the people who manage your network may not let
you do that!

Some printers have a built-in server. An example is the HP JetDirect
server built into the printer's network interface card. For those that
do not, you could screw something up if you tried printing directly to
the printer's IP address when someone else was printing via the server.

Fred
 
Hi Fred,
JJ-

Some installations use printer servers. Your computer sends a print job
to the server, where it is placed in the print queue. The server sends
each print job in the queue on to the printer, one at a time in the
order they were received.

When you attempt to find the printer's IP address, you may actually be
getting the IP address of the server. If that is the case, one way you
can find the IP address of a printer is from the printer's control panel
as has been suggested. Otherwise, you would need to access the server's
setup program to see the IP address where each printer name is routed.
Unless you are the boss, the people who manage your network may not let
you do that!

I think this is exactly it. I get the same IP address for two printers on
this system. Makes sense. We do have a print-server, so that's probably
what is happening.
Some printers have a built-in server. An example is the HP JetDirect
server built into the printer's network interface card. For those that
do not, you could screw something up if you tried printing directly to
the printer's IP address when someone else was printing via the server.

Yeah, wouldn't be trying to do that. Thx! This has been an education. I
appreciate the help. JJ
 
Is the printer connected to a print server that may service multiple
printers?

I think so yes. We have many printers connected.
If so, you MIGHT be able to get to the printer with \\ipaddress from the
printers menu if the admins allow listing printers off the print server.

I can connect to it just fine using the IP address through a browser or
"ping" command. What I'm trying to do is find a printer's IP address from
it's "name" like PRnn.
I take it you already tried letting your client print menu just scan for
printers.

I can see the printers by name, but can't seem to "extract" their IP
addresses that way. The only way I can get their IPs is manually in Control
Panel. I'm looking for a way to get a printer's IP from its name at the
*command line*. Thx for the input. JJ
 
JJ said:
I think so yes. We have many printers connected.


I can connect to it just fine using the IP address through a browser or
"ping" command. What I'm trying to do is find a printer's IP address from
it's "name" like PRnn.


I can see the printers by name, but can't seem to "extract" their IP
addresses that way. The only way I can get their IPs is manually in Control
Panel. I'm looking for a way to get a printer's IP from its name at the
*command line*. Thx for the input. JJ

Interesting! I had a quick Google and came up with these pages (I'm a
linux user but have a Windows desktop at work), so I might try some of
these things as well in the near future.

Go to C:\Windows\System32 and then run:

cscript prnmngr.vbs -l

This will list all printer and their details, including IP address.

Looks promising for further play:
http://www.robvanderwoude.com/2kprintcontrol.php
 
Gernot Hassenpflug said:
Interesting! I had a quick Google and came up with these pages (I'm a
linux user but have a Windows desktop at work), so I might try some of
these things as well in the near future.

Go to C:\Windows\System32 and then run:

cscript prnmngr.vbs -l

This will list all printer and their details, including IP address.

Looks promising for further play:
http://www.robvanderwoude.com/2kprintcontrol.php

Thanks for the input. I tried that command. Still not getting any IP
addresses but it works otherwise. I appreciate it! I'll have to check out
the link as well. Appreciate it, JJ
 
Back
Top