Managing Printers

The Win32_Printer WMI class represents a printing device connected to a computer running on a Microsoft Windows operating system. It allows to perform a bunch of monitoring and management tasks; some of them are presented in this section.

List of Installed Printers

To enumerate all the printers connected to a computer, you can either add Win32_Printer class to device's assets and explore contents of the Win32_Printer variable, or add the following WQL query:

SELECT * FROM Win32_Printer

Notice that if you use WQL, you can fetch only printers that satisfy some condition by adding a filter clauses to the request.

Modify Printer Properties

Some of printer's parameters are available for modification as writable properties. You just have to navigate to Device Configuration, open Win32_Printer table there and vary changeable properties for the printer of interest. Perhaps, the simplest and safest way to try this is to modify printer's comment represented by the Comment field.

Refer to Win32_Printer WMI class documentation for further details on other properties and their meaning.

Rename Printer

Having Win32_Printer class enabled in device assets, you can invoke its methods to control printers. For example, to rename a printer, you can invoke RenamePrinter action available (just as all other printer actions) from Win32_Printer sub-menu in device context menu.

Enumerate Current Printer Jobs

There are other WMI classes providing useful functionality for printing devices connected to a Windows computer. For instance, Win32_PrintJob WMI class represents unit of work associated with a specific printer. To get a list of current jobs for every printer, you can perform the following query:

SELECT Description, Document, Status, JobStatus, ElapsedTime, Priority FROM Win32_PrintJob

It fetches printer descriptions, documents being printed on them along with their statuses, elapsed times and priorities.

Explore documentation and WMI objects available on your real devices for more information.

Was this page helpful?