Home All Groups Group Topic Archive Search About

WMI Not Correctly Returning List of Network Printers

Author
30 Oct 2006 9:37 PM
le grand fromage
Hey, guys.  Here's the setup: I am writing a program for my college to take
computer inventory remotely by querying the WMI of every machine by
connecting via IP address.  This is working really nicely to get the Dell
serial number, network name, and OS version.  In order to tell what building
the machine is in, and ultimately what room, the program tries to get a list
of installed network printers.  WMI always returns an empty list, even though
I can see the network printers if I log in.  But here's the kicker: I
absolutely know I need to load the Win32_Printer driver before querying, but
there's no way to do it (as far as I can tell) in C#.NET.  Sure, I can tell
WMI to allow me to load drivers through the .Security_ property, but it still
comes up empty.  I have tried logging in locally, then using a piece of
VBScript to load the driver.  Then when I run my program I can see the
network printers, but without that script, they remain elusively hidden.  Any
suggestions would be greatly appreciated - this is starting to drive me crazy.

-le grand fromage

AddThis Social Bookmark Button