I am currently working on a project which gets information from a printer via snmp protocol
(Name, printed Pages, Toner levels...).
It is currently working when I have a printer IP Address, but I have to apply this in a very large company (means a huge network) and I need something that I can find all Printers in the Network.
This should run on a Windows based system in a batch script.
I know that i can find all IP's of the network with arp -a
or that it is possible to search trough out all IP's to find a printer.
But I have a subnetmask of 255.0.0.0
which means there are 16 million (16581375) IP's which I have to search which is very resource intense and time consuming.
In Windows control panel there is a option add network or wireless printer
where a list of all network printers is shared.
I cannot find any information how they get this list or any type of source code.
Does anyone know how windows get this list ?
Or is there a better way to get a list of all Network Printers rather than bruteforcing the whole network for printers?
And when bruteforcing is the only solution I need a better way to check if the IP belongs to a printer because sending an snmp
command to any IP is not the best way.