How to remotely detect printers?
-
I really dont know under which category this post should belong...My apologies.... As a company's intern, I was asked to research on this to see if I can do it. Basically, I am suppose to find a way for the network adminstrator to detect ALL printers connected to client machines and store the info (client machine name, printer model, etc) in a database. This includes all USB and parallel printers. I'm not really sure how to do this. My boss suggests using a "logon script" that automatically detect printers when logging on. For instance, when a Windows user logs on to the domain, some script should try to detect all locally connected printers on the client's machine and report that back to the central database. So my question is "Is this possible?". And if so, what programming/scripting language should I use? Perl, PHP, etc? Can I even do this using a .NET language?
-
I really dont know under which category this post should belong...My apologies.... As a company's intern, I was asked to research on this to see if I can do it. Basically, I am suppose to find a way for the network adminstrator to detect ALL printers connected to client machines and store the info (client machine name, printer model, etc) in a database. This includes all USB and parallel printers. I'm not really sure how to do this. My boss suggests using a "logon script" that automatically detect printers when logging on. For instance, when a Windows user logs on to the domain, some script should try to detect all locally connected printers on the client's machine and report that back to the central database. So my question is "Is this possible?". And if so, what programming/scripting language should I use? Perl, PHP, etc? Can I even do this using a .NET language?
I think it depends on the client machines and the exact requirements. The API of EnumPrinters and EnumPrinterConnections will be of use to you. YOu can use them to enumerate printers on remote clients - so in theory it could all be done from one machine (although you'd need administrator rights to log into the remote machines and do it.) On a domain, in theory you could query the domain for all machines currently connected (not sure if this is possible or how to do it... but it seems possible), then for each machine, call EnumPrinters and EnumPrinterConnections to get all the printers. The logon script idea would probably work, too, assuming you have a way of getting that information back to the central database or wherever. As for what language to use... probably straight Win32 C or C++ would be your best bet, since most of this will be calling Windows APIs. Sometimes I feel like I'm a USB printer in a parallel universe.