The circle of life – ** .Net – Training – MOSS **

  • Past Post

  • Vistor Locations

  • Advertisements

Display all network printers

Posted by Clayton James on November 27, 2008











A post that I know I will need again.


strServer = \\\\printservername;

//if the computer is local machine, use the “.” instead
ConnectionOptions options = new ConnectionOptions();
options.Username =
options.Password =
options.Authority =


ManagementScope myScope = new ManagementScope(strServer + \\root\\cimv2, options);
SelectQuery oQuery = new SelectQuery(“SELECT * FROM WIN32_Printer”);
ManagementObjectSearcher oResults = new ManagementObjectSearcher(myScope, oQuery);

//Iterate through printers…
foreach (ManagementObject oItem in oResults.Get())
     string strPrinterName = oItem.Properties[“DeviceID”].Value.ToString();


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: