Java - List all network printers on LAN
Asked Answered
S

1

6

I need to use Java to get a list of all the IP addresses on the LAN which belong to network printers. I don't need to print to the printers, I just need to find all of them. This is for an android application.

Just to be clear, I'm not trying to find the network printers which are configured on the local machine. I am trying to find ALL the printers which are available on the network.

I've tried http://www.velocityreviews.com/forums/t152882-dynamic-network-printer-discovery-and-administration-via-jcifs-samba-org.html already, and I am having trouble with getting the root smbfile to use that code, as my code will be running on multiple domains and networks so I can't hardcode it, and I can't figure out how to find the current domain using jcifs.

Stylize answered 27/5, 2011 at 20:3 Comment(3)
And by "find network printers" you mean "look them up in the domain controller"?Sachsen
Nowerdays there is no network printer without http server. Fetch the "index" and compare to a "network printer http index db". Most also have SNMP capability.Butters
I'm specifically looking for older printers, mostly HP Jetdirects. And yes, one way that I was thinking of finding the network printers was by looking them up in the domain controller, but if you know another way of doing what I described above, that's great too.Stylize
N
1

Finding "All" printers is fairly tall order.

However I would suggest using SNMP to walk the known ports.

a good SNMP implementation can be found at

http://www.snmp4j.org/

and this site has a good explanation of what you are looking for

http://www.irongeek.com/i.php?page=security/networkprinterhacking

Nob answered 17/7, 2011 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.