1

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.

enter image description here

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.

2
  • HP's WebJetAdmin and Xerox's CentreWareWeb will find all printers. Both are free downloads
    – hdhondt
    Commented May 24, 2019 at 4:55
  • 1
    A large company is likely to have multiple vlans (though that subnet mask may indicate otherwise). You're gonna have a tough time discovering anything across vlan boundarys. Commented Jan 22, 2021 at 4:03

1 Answer 1

1

As of Windows Vista, I believe you should use Web Services Dynamic Discovery (WS-Discovery). You will probably need to write a program for it.

From Wikipedia WS-Discovery:

Web Services Dynamic Discovery (WS-Discovery) is a technical specification that defines a multicast discovery protocol to locate services on a local network. It operates over TCP and UDP port 3702 and uses IP multicast address 239.255.255.250. As the name suggests, the actual communication between nodes is done using web services standards, notably SOAP-over-UDP.

Microsoft supplies the discovery library : A .NET class library that implements the WS-Discovery protocol (link).

You can also find an example C++ program at Web service discovery (WS-Discovery) sample, described as:

This sample shows how to use the Web Service Discovery API to perform WS-Discovery routines by using the IWSDiscoveryProvider, IWSDiscoveryProviderNotify, IWSDiscoveryPublisher and IWSDiscoveryPublisherNotify interfaces.

Some references that I found :

1
  • No guarantee any printers would respond to discovery requests. Commented Jan 22, 2021 at 4:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .