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.

QRohlf
  • 2,795
  • 3
  • 24
  • 27
  • And by "find network printers" you mean "look them up in the domain controller"? – Thorbjørn Ravn Andersen May 27 '11 at 20:05
  • 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. – PeterMmm May 27 '11 at 20:10
  • 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. – QRohlf May 28 '11 at 17:39

1 Answers1

1

Finding "All" printers is fairly tall order.

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

a good SNMP implementation cat 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

stimpy
  • 492
  • 1
  • 6
  • 18