Main example
List instances
# All instances of Win32_PrinterConfiguration, with the main properties
Get-CimInstance -ClassName Win32_PrinterConfiguration |
Select-Object -Property Name, Description, BitsPerPel, CaptionExamples
Filter with WQL
# WQL filter evaluated by the provider: Color = 1 (Monochrome (true black))
Get-CimInstance -ClassName Win32_PrinterConfiguration -Filter 'Color = 1' |
Select-Object -Property Name, Description, BitsPerPel, CaptionThe filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
Decode numeric values
# Lookup table for Color (values documented by Microsoft)
$colorName = @{
1 = 'Monochrome (true black)'
2 = 'Color'
}
# Lookup table for DitherType (values documented by Microsoft)
$ditherTypeName = @{
1 = 'No Dithering'
2 = 'Coarse Brush'
3 = 'Fine Brush'
4 = 'Line Art'
5 = 'Grayscale'
}
Get-CimInstance -ClassName Win32_PrinterConfiguration |
Select-Object -Property @(
'Name'
'Description'
'BitsPerPel'
'Caption'
@{ Name = 'Color'; Expression = { $colorName[[int]$_.Color] } }
@{ Name = 'DitherType'; Expression = { $ditherTypeName[[int]$_.DitherType] } }
)Query a remote computer (CIM session)
review before running# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
Get-CimInstance -CimSession $cimSession -ClassName Win32_PrinterConfiguration |
Select-Object -Property Name, Description, BitsPerPel, Caption
} finally {
Remove-CimSession -CimSession $cimSession
}WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.
Show the class structure
# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName Win32_PrinterConfiguration
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| BitsPerPel# | uint32 | read | Number of bits used to represent the color in this configuration (the bits per pixel). This property is obsolete. Instead, use properties in the Win32_VideoController, Win32_DesktopMonitor, or CIM_VideoControllerResolution classes to determine how color is represented. Code | ||||||||||||||||||
| Caption# | string | read | Short textual description of the current object. Code | ||||||||||||||||||
| Collate# | boolean | read | If TRUE, the pages that are printed should be collated. To collate is to print out the entire document before printing the next copy, as opposed to printing out each page of the document the required number of times. This property is ignored unless the printer driver indicates support for collation. Code | ||||||||||||||||||
| Color# | uint32 | read | Color of the document. Some color printers have the capability to print using true black instead of a combination of cyan, magenta, and yellow (CMY). This usually creates darker and sharper text for documents. This option is only useful for color printers that support true black printing. Values (2)
Code | ||||||||||||||||||
| Copies# | uint32 | read | Number of copies to be printed. The printer driver must support printing multi-page copies. Example: 2 Code | ||||||||||||||||||
| Description# | string | read | Textual description of the current object. Code | ||||||||||||||||||
| DeviceName# | string | read | Friendly name of the printer. This name is unique to the type of printer and may be truncated because of the limitations of the string from which it is derived. Example: "PCL/HP LaserJet" Code | ||||||||||||||||||
| DisplayFlags# | uint32 | read | Indicates whether the display device is color or monochrome and whether the type of scanning is noninterlaced or interlaced. This property is obsolete. Instead, use display properties such as the DisplayType property of the Win32_DesktopMonitor class. Code | ||||||||||||||||||
| DisplayFrequency# | uint32 | read | Displays the vertical refresh rate. The refresh rate for a monitor is the number of times the screen is redrawn per second (frequency). This property is obsolete. Instead, use properties in the Win32_VideoController, Win32_DesktopMonitor, or CIM_VideoControllerResolution class. Code | ||||||||||||||||||
| DitherType# | uint32 | read | Dither type of the printer. This property can assume predefined values of 1 to 5, or driver-defined values from 6 to 256. Line art dithering is a special dithering method that produces well defined borders between black, white, and gray scalings. It is not suitable for images that include continuous graduations in intensity and hue, such as scanned photographs. Values (5)
Code | ||||||||||||||||||
| DriverVersion# | uint32 | read | Version number of the Windows-based printer driver. The version numbers are created and maintained by the driver manufacturer. Code | ||||||||||||||||||
| Duplex# | boolean | read | If TRUE, printing is done on both sides. If FALSE, printing is done on only one side of the media. Code | ||||||||||||||||||
| FormName# | string | read | Not supported. Code | ||||||||||||||||||
| HorizontalResolution# | uint32 | read | Print resolution in dots per inch along the x-axis (width) of the print job (similar to the obsolete XResolution property). This value is only set when the PrintQuality property of this class is positive. Code | ||||||||||||||||||
| ICMIntent# | uint32 | read | Specific value of one of the three possible color matching methods (called intents) that should be used by default. ICM applications establish intents by using the ICM functions. This property can assume predefined values of 1 to 3, or driver-defined values from 4 to 256. Non-ICM applications can use this value to determine how the printer handles color printing jobs. Values (3)
Code | ||||||||||||||||||
| ICMMethod# | uint32 | read | How ICM is handled. For a non-ICM application, this property determines if ICM is enabled or disabled. For ICM applications, the system examines this property to determine which part of the computer system handles ICM support. Values (4)
Code | ||||||||||||||||||
| LogPixels# | uint32 | read | Number of pixels per logical inch. This obsolete property is valid only with devices that work with pixels, which excludes devices such as printers. There is no replacement value that applies to printers. Code | ||||||||||||||||||
| MediaType# | uint32 | read | Type of media on which the printer prints. The property can be set to a predefined value or a driver-defined value greater than or equal to 256. Values (3)
Code | ||||||||||||||||||
| Name# key | string | read | Name of the printer with which this configuration is associated. This value matches the Name property of the associated Win32_Printer instance. Code | ||||||||||||||||||
| Orientation# | uint32 | read | Printing orientation of the paper. Values (2)
Code | ||||||||||||||||||
| PaperLength# | uint32 | read | Length of the paper. To determine the size of the paper in inches, divide this value by 254. Example: 2794 Code | ||||||||||||||||||
| PaperSize# | string | read | Size of the paper. The possible sizes are found in the PaperSizesSupported property of the associated Win32_Printer class. Example: "A4 or Letter". Code | ||||||||||||||||||
| PaperWidth# | uint32 | read | Width of the paper. To determine the size of the paper in inches, divide this value by 254. Example: 2159 Code | ||||||||||||||||||
| PelsHeight# | uint32 | read | This property is not supported. Code | ||||||||||||||||||
| PelsWidth# | uint32 | read | This property is not supported. Code | ||||||||||||||||||
| PrintQuality# | uint32 | read | One of four quality levels of the print job. If a positive value is specified, the quality is measured in dots per inch. Values (4)
Code | ||||||||||||||||||
| Scale# | uint32 | read | Factor by which the printed output is to be scaled. For example, a scale of 75 reduces the print output to 3/4 its original height and width. Code | ||||||||||||||||||
| SettingID# | string | read | Identifier by which the current object is known. Code | ||||||||||||||||||
| SpecificationVersion# | uint32 | read | Version number of the initialization data for the device associated with the Windows-based printer. Code | ||||||||||||||||||
| TTOption# | uint32 | read | Indicates how TrueType fonts should be printed. Values (3)
Code | ||||||||||||||||||
| VerticalResolution# | uint32 | read | Print resolution along the y-axis (height) of the print job (similar to the obsolete YResolution property). This value is only set when the PrintQuality property of this class is positive. Code | ||||||||||||||||||
| XResolution# | uint32 | read | This property is obsolete. Use the HorizontalResolution property instead. Code | ||||||||||||||||||
| YResolution# | uint32 | read | This property is obsolete. Use the VerticalResolution property instead. Code |
Remarks
The Win32_PrinterConfiguration class is derived from CIM_Setting.
Overview
Before you can determine how to best distribute and use your printing resources, you must have a detailed knowledge of those resources. For example, Department A might have only three printers compared with five printers in Department B. However, if the printers in Department A can print 20 pages per minute and the printers in Department B can print only 5 pages per minute, users in Department A actually have more printing capacity. Without knowing the detailed capabilities of these printers, you might erroneously conclude that Department A is short on printing capacity and thus purchase additional printers that end up going unused.
WMI includes two classes, Win32_Printer and Win32_PrinterConfiguration, which can be used to return detailed information about all the printers installed on a computer.
Inheritance
Superclass chain
- CIM_Setting
- Win32_PrinterConfiguration
Known subclasses
No known subclass.
Requirements
- Namespace
- root/cimv2
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- MOF file
- Win32_Printer.mof
- DLL
- CIMWin32.dll
Microsoft source
Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.