The Win32_PrinterConfiguration WMI class represents the configuration for a printer device. This includes capabilities such as resolution, color, fonts, and orientation.
Methods
Win32_PrinterConfiguration has no methods.
Properties
Win32_PrinterConfiguration returns 33 properties:
'BitsPerPel','Caption','Collate','Color','Copies','Description','DeviceName',
'DisplayFlags','DisplayFrequency','DitherType','DriverVersion','Duplex','FormName',
'HorizontalResolution','ICMIntent','ICMMethod','LogPixels','MediaType','Name','Orientation','PaperLength',
'PaperSize','PaperWidth','PelsHeight','PelsWidth','PrintQuality','Scale','SettingID',
'SpecificationVersion','TTOption','VerticalResolution','XResolution','YResolution'
Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:
Get-CimInstance -ClassName Win32_PrinterConfiguration -Property *
Most WMI classes return one or more instances.
When
Get-CimInstance
returns no result, then apparently no instances of class Win32_PrinterConfiguration exist. This is normal behavior.Either the class is not implemented on your system (may be deprecated or due to missing drivers, i.e. CIM_VideoControllerResolution), or there are simply no physical representations of this class currently available (i.e. Win32_TapeDrive).
BitsPerPel
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, BitsPerPel
Caption
Short textual description of the current object.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Caption
Collate
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Collate
Color
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.
Monochrome (true black)
Color
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Color
Copies
Number of copies to be printed. The printer driver must support printing multi-page copies.
Example: 2
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Copies
Description
Textual description of the current object.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Description
DeviceName
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”
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, DeviceName
DisplayFlags
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, DisplayFlags
DisplayFrequency
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, DisplayFrequency
DitherType
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.
No Dithering
Coarse Brush
Fine Brush
Line Art
Grayscale
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, DitherType
DriverVersion
Version number of the Windows-based printer driver. The version numbers are created and maintained by the driver manufacturer.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, DriverVersion
Duplex
If TRUE, printing is done on both sides. If FALSE, printing is done on only one side of the media.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Duplex
FormName
Not supported.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, FormName
HorizontalResolution
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, HorizontalResolution
ICMIntent
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.
Saturation
Contrast
Exact Color
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, ICMIntent
ICMMethod
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.
Disabled
Windows
Device Driver
Device
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, ICMMethod
LogPixels
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, LogPixels
MediaType
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.
Standard
Transparency
Glossy
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, MediaType
Name
KEY PROPERTY STRING MAX 256 CHAR
Name of the printer with which this configuration is associated. This value matches the Name property of the associated Win32_Printer instance.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name
Orientation
Printing orientation of the paper.
Portrait
Landscape
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Orientation
PaperLength
Length of the paper. To determine the size of the paper in inches, divide this value by 254.
Example: 2794
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PaperLength
PaperSize
Size of the paper. The possible sizes are found in the PaperSizesSupported property of the associated Win32_Printer class.
Example: “A4 or Letter”.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PaperSize
PaperWidth
Width of the paper. To determine the size of the paper in inches, divide this value by 254.
Example: 2159
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PaperWidth
PelsHeight
This property is not supported.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PelsHeight
PelsWidth
This property is not supported.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PelsWidth
PrintQuality
One of four quality levels of the print job. If a positive value is specified, the quality is measured in dots per inch.
Draft
Low
Medium
High
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, PrintQuality
Scale
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, Scale
SettingID
Identifier by which the current object is known.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, SettingID
SpecificationVersion
Version number of the initialization data for the device associated with the Windows-based printer.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, SpecificationVersion
TTOption
Indicates how TrueType fonts should be printed.
TTOption returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use a PowerShell Hashtable
$TTOption_map = @{
1 = 'Bitmap'
2 = 'Download'
3 = 'Substitute'
}
Use a switch statement
switch([int]$value)
{
1 {'Bitmap'}
2 {'Download'}
3 {'Substitute'}
default {"$value"}
}
Use Enum structure
Enum EnumTTOption
{
Bitmap = 1
Download = 2
Substitute = 3
}
Examples
Use $TTOption_map in a calculated property for Select-Object
<#
this example uses a hashtable to translate raw numeric values for
property "TTOption" to friendly text
Note: to use other properties than "TTOption", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "TTOption"
# to translate other properties, use their translation table instead
$TTOption_map = @{
1 = 'Bitmap'
2 = 'Download'
3 = 'Substitute'
}
#endregion define hashtable
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "TTOption", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$TTOption = @{
Name = 'TTOption'
Expression = {
# property is an array, so process all values
$value = $_.TTOption
$TTOption_map[[int]$value]
}
}
#endregion define calculated property
# retrieve the instances, and output the properties "Caption" and "TTOption". The latter
# is defined by the hashtable in $TTOption:
Get-CimInstance -Class Win32_PrinterConfiguration | Select-Object -Property Caption, $TTOption
# ...or dump content of property TTOption:
$friendlyValues = Get-CimInstance -Class Win32_PrinterConfiguration |
Select-Object -Property $TTOption |
Select-Object -ExpandProperty TTOption
# output values
$friendlyValues
# output values as comma separated list
$friendlyValues -join ', '
# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $TTOption_map to directly translate raw values from an instance
<#
this example uses a hashtable to manually translate raw numeric values
for property "Win32_PrinterConfiguration" to friendly text. This approach is ideal when
there is just one instance to work with.
Note: to use other properties than "Win32_PrinterConfiguration", look up the appropriate
translation hashtable for the property you would like to use instead.
#>
#region define hashtable to translate raw values to friendly text
# Please note: this hashtable is specific for property "Win32_PrinterConfiguration"
# to translate other properties, use their translation table instead
$TTOption_map = @{
1 = 'Bitmap'
2 = 'Download'
3 = 'Substitute'
}
#endregion define hashtable
# get one instance:
$instance = Get-CimInstance -Class Win32_PrinterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to illustrate
the number-to-text translation. To process all instances, replace
"Select-Object -First 1" with a "Foreach-Object" loop, and use
the iterator variable $_ instead of $instance
#>
# query the property
$rawValue = $instance.TTOption
# translate raw value to friendly text:
$friendlyName = $TTOption_map[[int]$rawValue]
# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<#
this example uses a switch clause to translate raw numeric
values for property "TTOption" to friendly text. The switch
clause is embedded into a calculated property so there is
no need to refer to external variables for translation.
Note: to use other properties than "TTOption", look up the appropriate
translation switch clause for the property you would like to use instead.
#>
#region define calculated property (to be used with Select-Object)
<#
a calculated property is defined by a hashtable with keys "Name" and "Expression"
"Name" defines the name of the property (in this example, it is "TTOption", but you can rename it to anything else)
"Expression" defines a scriptblock that calculates the content of this property
in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
value to its friendly text counterpart:
#>
$TTOption = @{
Name = 'TTOption'
Expression = {
# property is an array, so process all values
$value = $_.TTOption
switch([int]$value)
{
1 {'Bitmap'}
2 {'Download'}
3 {'Substitute'}
default {"$value"}
}
}
}
#endregion define calculated property
# retrieve all instances...
Get-CimInstance -ClassName Win32_PrinterConfiguration |
# ...and output properties "Caption" and "TTOption". The latter is defined
# by the hashtable in $TTOption:
Select-Object -Property Caption, $TTOption
Use the Enum from above to auto-translate the code values
<#
this example translates raw values by means of type conversion
the friendly names are defined as enumeration using the
keyword "enum" (PowerShell 5 or better)
The raw value(s) are translated to friendly text by
simply converting them into the enum type.
Note: to use other properties than "Win32_PrinterConfiguration", look up the appropriate
enum definition for the property you would like to use instead.
#>
#region define enum with value-to-text translation:
Enum EnumTTOption
{
Bitmap = 1
Download = 2
Substitute = 3
}
#endregion define enum
# get one instance:
$instance = Get-CimInstance -Class Win32_PrinterConfiguration | Select-Object -First 1
<#
IMPORTANT: this example processes only one instance to focus on
the number-to-text type conversion.
To process all instances, replace "Select-Object -First 1"
with a "Foreach-Object" loop, and use the iterator variable
$_ instead of $instance
#>
# query the property:
$rawValue = $instance.TTOption
#region using strict type conversion
<#
Note: strict type conversion fails if the raw value is
not defined by the enum. So if the list of allowable values
was extended and the enum does not match the value,
an exception is thrown
#>
# convert the property to the enum **TTOption**
[EnumTTOption]$rawValue
# get a comma-separated string:
[EnumTTOption]$rawValue -join ','
#endregion
#region using operator "-as"
<#
Note: the operator "-as" accepts values not defined
by the enum and returns $null instead of throwing
an exception
#>
$rawValue -as [EnumTTOption]
#endregion
Enums must cover all possible values. If TTOption returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.
VerticalResolution
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.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, VerticalResolution
XResolution
This property is obsolete. Use the HorizontalResolution property instead.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, XResolution
YResolution
This property is obsolete. Use the VerticalResolution property instead.
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property Name, YResolution
Examples
List all instances of Win32_PrinterConfiguration
Get-CimInstance -ClassName Win32_PrinterConfiguration
Learn more about Get-CimInstance
and the deprecated Get-WmiObject
.
View all properties
Get-CimInstance -ClassName Win32_PrinterConfiguration -Property *
View key properties only
Get-CimInstance -ClassName Win32_PrinterConfiguration -KeyOnly
Selecting Properties
To select only some properties, pipe the results to Select-Object -Property a,b,c
with a comma-separated list of the properties you require. Wildcards are permitted.
Get-CimInstance
always returns all properties but only retrieves the ones that you specify. All other properties are empty but still present. That’s why you need to pipe the results into Select-Object
if you want to limit the visible properties, i.e. for reporting.
Selecting Properties
The code below lists all available properties. Remove the ones you do not need:
$properties = 'BitsPerPel',
'Caption',
'Collate',
'Color',
'Copies',
'Description',
'DeviceName',
'DisplayFlags',
'DisplayFrequency',
'DitherType',
'DriverVersion',
'Duplex',
'FormName',
'HorizontalResolution',
'ICMIntent',
'ICMMethod',
'LogPixels',
'MediaType',
'Name',
'Orientation',
'PaperLength',
'PaperSize',
'PaperWidth',
'PelsHeight',
'PelsWidth',
'PrintQuality',
'Scale',
'SettingID',
'SpecificationVersion',
'TTOption',
'VerticalResolution',
'XResolution',
'YResolution'
Get-CimInstance -ClassName Win32_PrinterConfiguration | Select-Object -Property $properties
Limiting Network Bandwidth
If you work remotely, it makes sense to limit network bandwidth by filtering the properties on the server side, too:
Get-CimInstance -Class Win32_PrinterConfiguration -Property $property |
Select-Object -Property $property
Selecting Instances
To select some instances, use Get-CimInstance and a WMI Query. The wildcard character in WMI Queries is % (and not “*”).
The parameter -Filter runs a simple query.
Listing all instances where the property Caption starts with “A”
Get-CimInstance -Class Win32_PrinterConfiguration -Filter 'Caption LIKE "a%"'
Using a WQL Query
The parameter -Query uses a query similar to SQL and combines the parameters -Filter and -Property. This returns all instances where the property Caption starts with “A”, and returns the properties specified:
Get-CimInstance -Query "SELECT DisplayFrequency, DitherType, DeviceName, Color FROM Win32_PrinterConfiguration WHERE Caption LIKE 'a%'"
Any property you did not specify is still present but empty. You might need to use
Select-Object
to remove all unwanted properties:Get-CimInstance -Query "SELECT DisplayFrequency, DitherType, DeviceName, Color FROM Win32_PrinterConfiguration WHERE Caption LIKE 'a%'" | Select-Object -Property DisplayFrequency, DitherType, DeviceName, Color
Accessing Remote Computers
To access remote systems, you need to have proper permissions. User the parameter -ComputerName to access one or more remote systems.
Authenticating as Current User
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with your current identity:
$result = Get-CimInstance -ClassName Win32_PrinterConfiguration -ComputerName $list
$result
Authenticating as Different User
Use a CIMSession object to authenticate with a new identity:
# one or more computer names or IP addresses:
$list = 'server1', 'server2'
# authenticate with a different identity:
$cred = Get-Credential -Message 'Authenticate to retrieve WMI information:'
$session = New-CimSession -ComputerName $list -Credential $cred
$result = Get-CimInstance Win32_PrinterConfiguration -CimSession $session
# remove the session after use (if you do not plan to re-use it later)
Remove-CimSession -CimSession $session
$result
Learn more about accessing remote computers.
Requirements
To use Win32_PrinterConfiguration, the following requirements apply:
PowerShell
Get-CimInstance
was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.
If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.
Operating System
Win32_PrinterConfiguration was introduced on clients with Windows Vista and on servers with Windows Server 2008.
Namespace
Win32_PrinterConfiguration lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance
.
Implementation
Win32_PrinterConfiguration is implemented in CIMWin32.dll and defined in Win32_Printer.mof. Both files are located in the folder C:\Windows\system32\wbem
:
explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\Win32_Printer.mof