Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Find all printers in a network or at least the printers IP

Writer Emily Wong

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

1 Answer

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 atWeb 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy