Win32_Printer

Win32 Printer

Represents a device connected to a computer running on a Microsoft Windows operating system that can produce a printed image or text on paper or other medium.

On this page

Main example

List instances

# All instances of Win32_Printer, with the main properties
Get-CimInstance -ClassName Win32_Printer |
    Select-Object -Property Name, DriverName, PortName, Default, Shared, PrinterStatus

Examples

Filter with WQL

# WQL filter evaluated by the provider: default printer
Get-CimInstance -ClassName Win32_Printer -Filter 'Default = TRUE' |
    Select-Object -Property Name, DriverName, PortName, Default, Shared, PrinterStatus

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Decode numeric values

# Lookup table for PrinterStatus (values documented by Microsoft)
$printerStatusName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Idle'
    4 = 'Printing'
    5 = 'Warmup'
    6 = 'Stopped Printing'
    7 = 'Offline'
}
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}

Get-CimInstance -ClassName Win32_Printer |
    Select-Object -Property @(
        'Name'
        'DriverName'
        'PortName'
        'Default'
        'Shared'
        @{ Name = 'PrinterStatus'; Expression = { $printerStatusName[[int]$_.PrinterStatus] } }
        @{ Name = 'Availability'; Expression = { $availabilityName[[int]$_.Availability] } }
    )

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_Printer |
        Select-Object -Property Name, DriverName, PortName, Default, Shared, PrinterStatus
} 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_Printer
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

# Methods of the class
$cimClass.CimClassMethods |
    Select-Object -Property Name, ReturnType

Properties

86 of 86 properties
NameTypeAccessDescription
Attributesuint32read

Bitmap of attributes for a Windows-based printing device.

Values (14)
ValueLabelDescription
1 (0x1)PRINTER_ATTRIBUTE_QUEUEDQueued Print jobs are buffered and queued.
2 (0x2)PRINTER_ATTRIBUTE_DIRECTDirect Document to be sent directly to the printer. This value is used if print jobs are not queued correctly.
4 (0x4)PRINTER_ATTRIBUTE_DEFAULTDefault Default printer on a computer.
8 (0x8)PRINTER_ATTRIBUTE_SHAREDShared Available as a shared network resource.
16 (0x10)PRINTER_ATTRIBUTE_NETWORKNetwork Attached to a network. If both Local and Network bits are set, this indicates a network printer.
32 (0x20)PRINTER_ATTRIBUTE_HIDDENHidden Hidden from some users on the network.
64 (0x40)PRINTER_ATTRIBUTE_LOCALLocal Directly connected to a computer. If both Local and Network bits are set, this indicates a network printer.
128 (0x80)PRINTER_ATTRIBUTE_ENABLEDEVQEnableDevQ Enable the queue on the printer if available.
256 (0x100)PRINTER_ATTRIBUTE_KEEPPRINTEDJOBSKeepPrintedJobs Spooler should not delete documents after they are printed.
512 (0x200)PRINTER_ATTRIBUTE_DO_COMPLETE_FIRSTDoCompleteFirst Start jobs that are finished spooling first.
1024 (0x400)PRINTER_ATTRIBUTE_WORK_OFFLINEWorkOffline Queue print jobs when a printer is not available.
2048 (0x800)PRINTER_ATTRIBUTE_ENABLE_BIDIEnableBIDI Enable bidirectional printing.
4096 (0x1000)PRINTER_ATTRIBUTE_RAW_ONLYAllow only raw data type jobs to be spooled.
8192 (0x2000)PRINTER_ATTRIBUTE_PUBLISHEDPublished Published in the network directory service.
Code
# Value of Attributes for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Attributes |
    Select-Object -Property DeviceID, Attributes
Availabilityuint16read

Availability and status of the device.

Values (21)
ValueLabelDescription
1Other
2Unknown
3Running/Full PowerRunning or Full Power
4Warning
5In Test
6Not Applicable
7Power Off
8Off Line
9Off Duty
10Degraded
11Not Installed
12Install Error
13Power Save - UnknownThe device is known to be in a power save mode, but its exact status is unknown.
14Power Save - Low Power ModeThe device is in a power save state but is still functioning, and may exhibit degraded performance.
15Power Save - StandbyThe device is not functioning, but could be brought to full power quickly.
16Power Cycle
17Power Save - WarningThe device is in a warning state, though also in a power save mode.
18PausedThe device is paused.
19Not ReadyThe device is not ready.
20Not ConfiguredThe device is not configured.
21QuiescedThe device is quiet.
Code
# Value of Availability for each instance
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Availability |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'Availability'; Expression = { $availabilityName[[int]$_.Availability] } }
    )
AvailableJobSheetsstring[]read

Array of all the job sheets available on a printer. Can also be used to describe the banner that a printer might provide at the beginning of each job, or other user-specified options.

Code
# Value of AvailableJobSheets for each instance
# AvailableJobSheets is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property AvailableJobSheets |
    Select-Object -ExpandProperty AvailableJobSheets
AveragePagesPerMinuteuint32read

Printing rate, in average number of pages per minute, that a printer can produce output.

Code
# Value of AveragePagesPerMinute for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, AveragePagesPerMinute |
    Select-Object -Property DeviceID, AveragePagesPerMinute
Capabilitiesuint16[]read

Array of printer capabilities.

Values (22)
ValueLabelDescription
0Unknown
1Other
2Color Printing
3Duplex Printing
4Copies
5Collation
6Stapling
7Transparency Printing
8Punch
9Cover
10Bind
11Black and White Printing
12One SidedOne-Sided
13Two Sided Long EdgeTwo-Sided Long Edge
14Two Sided Short EdgeTwo-Sided Short Edge
15Portrait
16Landscape
17Reverse Portrait
18Reverse Landscape
19Quality High
20Quality Normal
21Quality Low
Code
# Value of Capabilities for each instance
# Lookup table for Capabilities (values documented by Microsoft)
$capabilitiesName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'Color Printing'
    3 = 'Duplex Printing'
    4 = 'Copies'
    5 = 'Collation'
    6 = 'Stapling'
    7 = 'Transparency Printing'
    8 = 'Punch'
    9 = 'Cover'
    10 = 'Bind'
    11 = 'Black and White Printing'
    12 = 'One Sided'
    13 = 'Two Sided Long Edge'
    14 = 'Two Sided Short Edge'
    15 = 'Portrait'
    16 = 'Landscape'
    17 = 'Reverse Portrait'
    18 = 'Reverse Landscape'
    19 = 'Quality High'
    20 = 'Quality Normal'
    21 = 'Quality Low'
}
# Capabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property Capabilities |
    Select-Object -ExpandProperty Capabilities |
    ForEach-Object -Process { $capabilitiesName[[int]$_] }
CapabilityDescriptionsstring[]read

Array of free-form strings that provide detailed explanations for the printer features indicated in the Capabilities array. Each entry of this array is related to an entry in the Capabilities array that is located in the same index.

Code
# Value of CapabilityDescriptions for each instance
# CapabilityDescriptions is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property CapabilityDescriptions |
    Select-Object -ExpandProperty CapabilityDescriptions
Captionstringread

Short description of an object—a one-line string.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Caption |
    Select-Object -Property DeviceID, Caption
CharSetsSupportedstring[]read

Array of available character sets for output. Strings provided in this property must conform to the semantics and syntax specified by section 4.1.2 ("Charset parameters") in RFC 2046 (MIME Part 2) and contained in the IANA character-set registry. Examples include, "UTF-8", "us-ASCII", and "iso-8859-1".

Code
# Value of CharSetsSupported for each instance
# CharSetsSupported is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property CharSetsSupported |
    Select-Object -ExpandProperty CharSetsSupported
Commentstringread/write

Comment for a print queue.

Example: Color printer

Code
# Value of Comment for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Comment |
    Select-Object -Property DeviceID, Comment

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Comment on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Comment = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ConfigManagerErrorCodeuint32read

Win32 Configuration Manager error code.

Values (32)
ValueLabelDescription
0This device is working properly.Device is working properly.
1This device is not configured correctly.Device is not configured correctly.
2Windows cannot load the driver for this device.
3The driver for this device might be corrupted, or your system may be running low on memory or other resources.Driver for this device might be corrupted, or the system may be low on memory or other resources.
4This device is not working properly. One of its drivers or your registry might be corrupted.Device is not working properly. One of its drivers or the registry might be corrupted.
5The driver for this device needs a resource that Windows cannot manage.Driver for the device requires a resource that Windows cannot manage.
6The boot configuration for this device conflicts with other devices.Boot configuration for the device conflicts with other devices.
7Cannot filter.
8The driver loader for the device is missing.Driver loader for the device is missing.
9This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.
10This device cannot start.Device cannot start.
11This device failed.Device failed.
12This device cannot find enough free resources that it can use.Device cannot find enough free resources to use.
13Windows cannot verify this device's resources.Windows cannot verify the device's resources.
14This device cannot work properly until you restart your computer.Device cannot work properly until the computer is restarted.
15This device is not working properly because there is probably a re-enumeration problem.Device is not working properly due to a possible re-enumeration problem.
16Windows cannot identify all the resources this device uses.Windows cannot identify all of the resources that the device uses.
17This device is asking for an unknown resource type.Device is requesting an unknown resource type.
18Reinstall the drivers for this device.Device drivers must be reinstalled.
19Failure using the VxD loader.
20Your registry might be corrupted.Registry might be corrupted.
21System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.
22This device is disabled.Device is disabled.
23System failure: Try changing the driver for this device. If that doesn't work, see your hardware documentation.System failure. If changing the device driver is ineffective, see the hardware documentation.
24This device is not present, is not working properly, or does not have all its drivers installed.Device is not present, not working properly, or does not have all of its drivers installed.
25Windows is still setting up this device.Windows is still setting up the device.
26Windows is still setting up this device.Windows is still setting up the device.
27This device does not have valid log configuration.Device does not have a valid log configuration.
28The drivers for this device are not installed.Device drivers are not installed.
29This device is disabled because the firmware of the device did not give it the required resources.Device is disabled. The device firmware did not provide the required resources.
30This device is using an Interrupt Request (IRQ) resource that another device is using.Device is using an IRQ resource that another device is using.
31This device is not working properly because Windows cannot load the drivers required for this device.Device is not working properly. Windows cannot load the required device drivers.
Code
# Value of ConfigManagerErrorCode for each instance
# Lookup table for ConfigManagerErrorCode (values documented by Microsoft)
$configManagerErrorCodeName = @{
    0 = 'This device is working properly'
    1 = 'This device is not configured correctly'
    2 = 'Windows cannot load the driver for this device'
    3 = 'The driver for this device might be corrupted, or your…'
    4 = 'This device is not working properly'
    5 = 'The driver for this device needs a resource that Windows…'
    6 = 'The boot configuration for this device conflicts with other…'
    7 = 'Cannot filter'
    8 = 'The driver loader for the device is missing'
    9 = 'This device is not working properly because the controlling…'
    10 = 'This device cannot start'
    11 = 'This device failed'
    12 = 'This device cannot find enough free resources that it can use'
    13 = 'Windows cannot verify this device''s resources'
    14 = 'This device cannot work properly until you restart your…'
    15 = 'This device is not working properly because there is…'
    16 = 'Windows cannot identify all the resources this device uses'
    17 = 'This device is asking for an unknown resource type'
    18 = 'Reinstall the drivers for this device'
    19 = 'Failure using the VxD loader'
    20 = 'Your registry might be corrupted'
    21 = 'System failure: Try changing the driver for this device'
    22 = 'This device is disabled'
    23 = 'System failure: Try changing the driver for this device'
    24 = 'This device is not present, is not working properly, or does…'
    25 = 'Windows is still setting up this device'
    26 = 'Windows is still setting up this device'
    27 = 'This device does not have valid log configuration'
    28 = 'The drivers for this device are not installed'
    29 = 'This device is disabled because the firmware of the device…'
    30 = 'This device is using an Interrupt Request (IRQ) resource…'
    31 = 'This device is not working properly because Windows cannot…'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ConfigManagerErrorCode |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'ConfigManagerErrorCode'; Expression = { $configManagerErrorCodeName[[int]$_.ConfigManagerErrorCode] } }
    )
ConfigManagerUserConfigbooleanread

If TRUE, the device is using a user-defined configuration.

Code
# Value of ConfigManagerUserConfig for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ConfigManagerUserConfig |
    Select-Object -Property DeviceID, ConfigManagerUserConfig
CreationClassName keystringread

Name of the first concrete class to appear in the inheritance chain used to create an instance. When used with other key properties of the class, the property allows all instances of this class and its subclasses to be identified uniquely.

Code
# Value of CreationClassName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CreationClassName |
    Select-Object -Property DeviceID, CreationClassName
CurrentCapabilitiesuint16[]read

Array of printer capabilities that are being used currently. An entry in this property must also be listed in the Capabilities array.

Values (22)
ValueLabelDescription
0Unknown
1Other
2Color Printing
3Duplex Printing
4Copies
5Collation
6Stapling
7Transparency Printing
8Punch
9Cover
10Bind
11Black and White Printing
12One SidedOne-Sided
13Two Sided Long EdgeTwo-Sided Long Edge
14Two Sided Short EdgeTwo-Sided Short Edge
15Portrait
16Landscape
17Reverse Portrait
18Reverse Landscape
19Quality High
20Quality Normal
21Quality Low
Code
# Value of CurrentCapabilities for each instance
# Lookup table for CurrentCapabilities (values documented by Microsoft)
$currentCapabilitiesName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'Color Printing'
    3 = 'Duplex Printing'
    4 = 'Copies'
    5 = 'Collation'
    6 = 'Stapling'
    7 = 'Transparency Printing'
    8 = 'Punch'
    9 = 'Cover'
    10 = 'Bind'
    11 = 'Black and White Printing'
    12 = 'One Sided'
    13 = 'Two Sided Long Edge'
    14 = 'Two Sided Short Edge'
    15 = 'Portrait'
    16 = 'Landscape'
    17 = 'Reverse Portrait'
    18 = 'Reverse Landscape'
    19 = 'Quality High'
    20 = 'Quality Normal'
    21 = 'Quality Low'
}
# CurrentCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property CurrentCapabilities |
    Select-Object -ExpandProperty CurrentCapabilities |
    ForEach-Object -Process { $currentCapabilitiesName[[int]$_] }
CurrentCharSetstringread

The character set currently used for output. Strings provided in this property must conform to the semantics and syntax specified by section 4.1.2 ("Charset parameters") in RFC 2046 (MIME Part 2) and contained in the IANA character-set registry. Examples include "utf-8", "us-ASCII", and iso-8859-1.

Code
# Value of CurrentCharSet for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CurrentCharSet |
    Select-Object -Property DeviceID, CurrentCharSet
CurrentLanguageuint16read

Printer language currently used. The language used must be listed in the LanguagesSupported property.

48

XPS

49

HPGL2

50

PCLXL

Values (47)
ValueLabelDescription
1Other
2Unknown
3PCL
4HPGL
5PJL
6PS
7PSPrinter
8IPDS
9PPDS
10EscapeP
11Epson
12DDIF
13Interpress
14ISO6429
15Line DataLineData
16MODCADODCA
17REGIS
18SCS
19SPDL
20TEK4014
21PDS
22IGP
23CodeV
24DSCDSE
25WPS
26LN03
27CCITT
28QUIC
29CPAP
30DecPPL
31Simple TextSimpleText
32NPAP
33DOC
34imPress
35Pinwriter
36NPDL
37NEC201PL
38Automatic
39Pages
40LIPS
41TIFF
42Diagnostic
43CaPSL
44EXCL
45LCDS
46XES
47MIME
Code
# Value of CurrentLanguage for each instance
# Lookup table for CurrentLanguage (values documented by Microsoft)
$currentLanguageName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'PCL'
    4 = 'HPGL'
    5 = 'PJL'
    6 = 'PS'
    7 = 'PSPrinter'
    8 = 'IPDS'
    9 = 'PPDS'
    10 = 'EscapeP'
    11 = 'Epson'
    12 = 'DDIF'
    13 = 'Interpress'
    14 = 'ISO6429'
    15 = 'Line Data'
    16 = 'MODCA'
    17 = 'REGIS'
    18 = 'SCS'
    19 = 'SPDL'
    20 = 'TEK4014'
    21 = 'PDS'
    22 = 'IGP'
    23 = 'CodeV'
    24 = 'DSCDSE'
    25 = 'WPS'
    26 = 'LN03'
    27 = 'CCITT'
    28 = 'QUIC'
    29 = 'CPAP'
    30 = 'DecPPL'
    31 = 'Simple Text'
    32 = 'NPAP'
    33 = 'DOC'
    34 = 'imPress'
    35 = 'Pinwriter'
    36 = 'NPDL'
    37 = 'NEC201PL'
    38 = 'Automatic'
    39 = 'Pages'
    40 = 'LIPS'
    41 = 'TIFF'
    42 = 'Diagnostic'
    43 = 'CaPSL'
    44 = 'EXCL'
    45 = 'LCDS'
    46 = 'XES'
    47 = 'MIME'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CurrentLanguage |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'CurrentLanguage'; Expression = { $currentLanguageName[[int]$_.CurrentLanguage] } }
    )
CurrentMimeTypestringread

MIME type currently being used if the CurrentLanguage is a MIME type (value = 47).

Code
# Value of CurrentMimeType for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CurrentMimeType |
    Select-Object -Property DeviceID, CurrentMimeType
CurrentNaturalLanguagestringread

Language that the printer is using for management currently. The language listed here must also be listed in the NaturalLanguagesSupported property.

Code
# Value of CurrentNaturalLanguage for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CurrentNaturalLanguage |
    Select-Object -Property DeviceID, CurrentNaturalLanguage
CurrentPaperTypestringread

Type of paper the printer is using. Must be expressed in the form specified by the ISO/IEC 10175 Document Printing Application (DPA), which is summarized in Appendix C of RFC 1759 (Printer MIB).

Code
# Value of CurrentPaperType for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, CurrentPaperType |
    Select-Object -Property DeviceID, CurrentPaperType
Defaultbooleanread

If TRUE, the printer is the default printer.

Code
# Value of Default for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Default |
    Select-Object -Property DeviceID, Default
DefaultCapabilitiesuint16[]read

Array of the printer capabilities used by default. Each entry in the DefaultCapabilities array must also be listed in the Capabilities array.

Values (22)
ValueLabelDescription
0Unknown
1Other
2Color Printing
3Duplex Printing
4Copies
5Collation
6Stapling
7Transparency Printing
8Punch
9Cover
10Bind
11Black and White Printing
12One SidedOne-Sided
13Two Sided Long EdgeTwo-Sided Long Edge
14Two Sided Short EdgeTwo-Sided Short Edge
15Portrait
16Landscape
17Reverse Portrait
18Reverse Landscape
19Quality High
20Quality Normal
21Quality Low
Code
# Value of DefaultCapabilities for each instance
# Lookup table for DefaultCapabilities (values documented by Microsoft)
$defaultCapabilitiesName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'Color Printing'
    3 = 'Duplex Printing'
    4 = 'Copies'
    5 = 'Collation'
    6 = 'Stapling'
    7 = 'Transparency Printing'
    8 = 'Punch'
    9 = 'Cover'
    10 = 'Bind'
    11 = 'Black and White Printing'
    12 = 'One Sided'
    13 = 'Two Sided Long Edge'
    14 = 'Two Sided Short Edge'
    15 = 'Portrait'
    16 = 'Landscape'
    17 = 'Reverse Portrait'
    18 = 'Reverse Landscape'
    19 = 'Quality High'
    20 = 'Quality Normal'
    21 = 'Quality Low'
}
# DefaultCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property DefaultCapabilities |
    Select-Object -ExpandProperty DefaultCapabilities |
    ForEach-Object -Process { $defaultCapabilitiesName[[int]$_] }
DefaultCopiesuint32read

Number of copies produced for one job—unless otherwise specified.

Code
# Value of DefaultCopies for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultCopies |
    Select-Object -Property DeviceID, DefaultCopies
DefaultLanguageuint16read

Default printer language. The language listed here must also be listed in the LanguagesSupported property.

48

XPS

49

HPGL2

50

PCLXL

Values (47)
ValueLabelDescription
1Other
2Unknown
3PCL
4HPGL
5PJL
6PS
7PSPrinter
8IPDS
9PPDS
10EscapeP
11Epson
12DDIF
13Interpress
14ISO6429
15Line DataLineData
16MODCADODCA
17REGIS
18SCS
19SPDL
20TEK4014
21PDS
22IGP
23CodeV
24DSCDSE
25WPS
26LN03
27CCITT
28QUIC
29CPAP
30DecPPL
31Simple TextSimpleText
32NPAP
33DOC
34imPress
35Pinwriter
36NPDL
37NEC201PL
38Automatic
39Pages
40LIPS
41TIFF
42Diagnostic
43CaPSL
44EXCL
45LCDS
46XES
47MIME
Code
# Value of DefaultLanguage for each instance
# Lookup table for DefaultLanguage (values documented by Microsoft)
$defaultLanguageName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'PCL'
    4 = 'HPGL'
    5 = 'PJL'
    6 = 'PS'
    7 = 'PSPrinter'
    8 = 'IPDS'
    9 = 'PPDS'
    10 = 'EscapeP'
    11 = 'Epson'
    12 = 'DDIF'
    13 = 'Interpress'
    14 = 'ISO6429'
    15 = 'Line Data'
    16 = 'MODCA'
    17 = 'REGIS'
    18 = 'SCS'
    19 = 'SPDL'
    20 = 'TEK4014'
    21 = 'PDS'
    22 = 'IGP'
    23 = 'CodeV'
    24 = 'DSCDSE'
    25 = 'WPS'
    26 = 'LN03'
    27 = 'CCITT'
    28 = 'QUIC'
    29 = 'CPAP'
    30 = 'DecPPL'
    31 = 'Simple Text'
    32 = 'NPAP'
    33 = 'DOC'
    34 = 'imPress'
    35 = 'Pinwriter'
    36 = 'NPDL'
    37 = 'NEC201PL'
    38 = 'Automatic'
    39 = 'Pages'
    40 = 'LIPS'
    41 = 'TIFF'
    42 = 'Diagnostic'
    43 = 'CaPSL'
    44 = 'EXCL'
    45 = 'LCDS'
    46 = 'XES'
    47 = 'MIME'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultLanguage |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'DefaultLanguage'; Expression = { $defaultLanguageName[[int]$_.DefaultLanguage] } }
    )
DefaultMimeTypestringread

MIME type currently being used, if the DefaultLanguage value is a MIME type (value = 47).

Code
# Value of DefaultMimeType for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultMimeType |
    Select-Object -Property DeviceID, DefaultMimeType
DefaultNumberUpuint32read

Number of print-stream pages that the printer renders on one media sheet—unless a job specifies otherwise.

Code
# Value of DefaultNumberUp for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultNumberUp |
    Select-Object -Property DeviceID, DefaultNumberUp
DefaultPaperTypestringread

Paper type that the printer uses—unless a print job specifies a different paper type. The string must be expressed in the form specified by ISO/IEC 1017 Document Printing Application (DPA), which is summarized in Appendix C of RFC 1759 (Printer MIB).

Code
# Value of DefaultPaperType for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultPaperType |
    Select-Object -Property DeviceID, DefaultPaperType
DefaultPriorityuint32read/write

Default priority value assigned to each print job.

Code
# Value of DefaultPriority for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DefaultPriority |
    Select-Object -Property DeviceID, DefaultPriority

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DefaultPriority on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ DefaultPriority = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Descriptionstringread

Description of an object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Description |
    Select-Object -Property DeviceID, Description
DetectedErrorStateuint16read

Printer error information.

Values (12)
ValueLabelDescription
0Unknown
1Other
2No Error
3Low Paper
4No Paper
5Low Toner
6No Toner
7Door Open
8Jammed
9Offline
10Service Requested
11Output Bin Full
Code
# Value of DetectedErrorState for each instance
# Lookup table for DetectedErrorState (values documented by Microsoft)
$detectedErrorStateName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'No Error'
    3 = 'Low Paper'
    4 = 'No Paper'
    5 = 'Low Toner'
    6 = 'No Toner'
    7 = 'Door Open'
    8 = 'Jammed'
    9 = 'Offline'
    10 = 'Service Requested'
    11 = 'Output Bin Full'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DetectedErrorState |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'DetectedErrorState'; Expression = { $detectedErrorStateName[[int]$_.DetectedErrorState] } }
    )
DeviceID keystringread

Unique identifier of the printer on a system.

Code
# Value of DeviceID for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID |
    Select-Object -Property DeviceID
Directbooleanread/write

If TRUE, the print job is sent directly to the printer. If FALSE, the print job is spooled.

Code
# Value of Direct for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Direct |
    Select-Object -Property DeviceID, Direct

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Direct on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Direct = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
DoCompleteFirstbooleanread/write

If TRUE, the printer starts jobs that are finished spooling. If FALSE, the printer starts jobs in the order that the jobs are received.

Code
# Value of DoCompleteFirst for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DoCompleteFirst |
    Select-Object -Property DeviceID, DoCompleteFirst

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DoCompleteFirst on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ DoCompleteFirst = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
DriverNamestringread/write

Name of the Windows printer driver.

Example: Windows Fax Driver

Code
# Value of DriverName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, DriverName |
    Select-Object -Property DeviceID, DriverName

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DriverName on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ DriverName = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
EnableBIDIbooleanread/write

If TRUE, the printer can print bidirectionally.

Code
# Value of EnableBIDI for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, EnableBIDI |
    Select-Object -Property DeviceID, EnableBIDI

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes EnableBIDI on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ EnableBIDI = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
EnableDevQueryPrintbooleanread/write

If TRUE, the printer holds documents in the queue when document and printer setups do not match.

Code
# Value of EnableDevQueryPrint for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, EnableDevQueryPrint |
    Select-Object -Property DeviceID, EnableDevQueryPrint

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes EnableDevQueryPrint on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ EnableDevQueryPrint = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ErrorClearedbooleanread

If TRUE, the error reported in LastErrorCode has been cleared.

Code
# Value of ErrorCleared for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ErrorCleared |
    Select-Object -Property DeviceID, ErrorCleared
ErrorDescriptionstringread

Information about the error recorded in LastErrorCode, and information about corrective actions that can be taken.

Code
# Value of ErrorDescription for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ErrorDescription |
    Select-Object -Property DeviceID, ErrorDescription
ErrorInformationstring[]read/write

Array of supplemental information for the current error state indicated in DetectedErrorState.

Code
# Value of ErrorInformation for each instance
# ErrorInformation is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property ErrorInformation |
    Select-Object -ExpandProperty ErrorInformation

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes ErrorInformation on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ ErrorInformation = @('Example') }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ExtendedDetectedErrorStateuint16read

Reports standard error information. Additional information should be recorded in DetectedErrorState.

Values are:

Values (16)
ValueLabelDescription
0Unknown
1Other
2No Error
3Low Paper
4No Paper
5Low Toner
6No Toner
7Door Open
8Jammed
9Service Requested
10Output Bin Full
11Paper Problem
12Cannot Print Page
13User Intervention Required
14Out of Memory
15Server Unknown
Code
# Value of ExtendedDetectedErrorState for each instance
# Lookup table for ExtendedDetectedErrorState (values documented by Microsoft)
$extendedDetectedErrorStateName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'No Error'
    3 = 'Low Paper'
    4 = 'No Paper'
    5 = 'Low Toner'
    6 = 'No Toner'
    7 = 'Door Open'
    8 = 'Jammed'
    9 = 'Service Requested'
    10 = 'Output Bin Full'
    11 = 'Paper Problem'
    12 = 'Cannot Print Page'
    13 = 'User Intervention Required'
    14 = 'Out of Memory'
    15 = 'Server Unknown'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ExtendedDetectedErrorState |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'ExtendedDetectedErrorState'; Expression = { $extendedDetectedErrorStateName[[int]$_.ExtendedDetectedErrorState] } }
    )
ExtendedPrinterStatusuint16read

Status information for a printer that is different from information specified in the Availability property.

7

Offline

15

Power Save

Values (16)
ValueLabelDescription
1Other
2Unknown
3Idle
4Printing
5Warming Up
6Stopped Printing
8Paused
9Error
10Busy
11Not Available
12Waiting
13Processing
14Initialization
16Pending Deletion
17I/O Active
18Manual Feed
Code
# Value of ExtendedPrinterStatus for each instance
# Lookup table for ExtendedPrinterStatus (values documented by Microsoft)
$extendedPrinterStatusName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Idle'
    4 = 'Printing'
    5 = 'Warming Up'
    6 = 'Stopped Printing'
    8 = 'Paused'
    9 = 'Error'
    10 = 'Busy'
    11 = 'Not Available'
    12 = 'Waiting'
    13 = 'Processing'
    14 = 'Initialization'
    16 = 'Pending Deletion'
    17 = 'I/O Active'
    18 = 'Manual Feed'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ExtendedPrinterStatus |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'ExtendedPrinterStatus'; Expression = { $extendedPrinterStatusName[[int]$_.ExtendedPrinterStatus] } }
    )
Hiddenbooleanread/write

If TRUE, the printer is hidden from network users.

Code
# Value of Hidden for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Hidden |
    Select-Object -Property DeviceID, Hidden

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Hidden on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Hidden = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
HorizontalResolutionuint32read

Horizontal resolution of the printer—in pixels per inch.

Unit: pixels per inch

Code
# Value of HorizontalResolution for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, HorizontalResolution |
    Select-Object -Property DeviceID, HorizontalResolution
InstallDatedatetimeread

Date and time an object was installed. The object may be installed without a value being written to this property. This property is inherited from CIM_ManagedSystemElement.

Code
# Value of InstallDate for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, InstallDate |
    Select-Object -Property DeviceID, InstallDate
JobCountSinceLastResetuint32read

Number of print jobs since the printer was last reset.

Code
# Value of JobCountSinceLastReset for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, JobCountSinceLastReset |
    Select-Object -Property DeviceID, JobCountSinceLastReset
KeepPrintedJobsbooleanread/write

If TRUE, the print spooler does not delete the completed jobs.

Code
# Value of KeepPrintedJobs for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, KeepPrintedJobs |
    Select-Object -Property DeviceID, KeepPrintedJobs

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes KeepPrintedJobs on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ KeepPrintedJobs = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
LanguagesSupporteduint16[]read

Array of the print languages natively supported.

Values (50)
ValueLabelDescription
1Other
2Unknown
3PCL
4HPGL
5PJL
6PS
7PSPrinter
8IPDS
9PPDS
10EscapeP
11Epson
12DDIF
13Interpress
14ISO6429
15Line DataLineData
16MODCADODCA
17REGIS
18SCS
19SPDL
20TEK4014
21PDS
22IGP
23CodeV
24DSCDSE
25WPS
26LN03
27CCITT
28QUIC
29CPAP
30DecPPL
31Simple TextSimpleText
32NPAP
33DOC
34imPress
35Pinwriter
36NPDL
37NEC201PL
38Automatic
39Pages
40LIPS
41TIFF
42Diagnostic
43CaPSL
44EXCL
45LCDS
46XES
47MIME
48XPS
49HPGL2
50PCLXL
Code
# Value of LanguagesSupported for each instance
# Lookup table for LanguagesSupported (values documented by Microsoft)
$languagesSupportedName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'PCL'
    4 = 'HPGL'
    5 = 'PJL'
    6 = 'PS'
    7 = 'PSPrinter'
    8 = 'IPDS'
    9 = 'PPDS'
    10 = 'EscapeP'
    11 = 'Epson'
    12 = 'DDIF'
    13 = 'Interpress'
    14 = 'ISO6429'
    15 = 'Line Data'
    16 = 'MODCA'
    17 = 'REGIS'
    18 = 'SCS'
    19 = 'SPDL'
    20 = 'TEK4014'
    21 = 'PDS'
    22 = 'IGP'
    23 = 'CodeV'
    24 = 'DSCDSE'
    25 = 'WPS'
    26 = 'LN03'
    27 = 'CCITT'
    28 = 'QUIC'
    29 = 'CPAP'
    30 = 'DecPPL'
    31 = 'Simple Text'
    32 = 'NPAP'
    33 = 'DOC'
    34 = 'imPress'
    35 = 'Pinwriter'
    36 = 'NPDL'
    37 = 'NEC201PL'
    38 = 'Automatic'
    39 = 'Pages'
    40 = 'LIPS'
    41 = 'TIFF'
    42 = 'Diagnostic'
    43 = 'CaPSL'
    44 = 'EXCL'
    45 = 'LCDS'
    46 = 'XES'
    47 = 'MIME'
    48 = 'XPS'
    49 = 'HPGL2'
    50 = 'PCLXL'
}
# LanguagesSupported is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property LanguagesSupported |
    Select-Object -ExpandProperty LanguagesSupported |
    ForEach-Object -Process { $languagesSupportedName[[int]$_] }
LastErrorCodeuint32read

Last error code that the logical device reports.

Code
# Value of LastErrorCode for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, LastErrorCode |
    Select-Object -Property DeviceID, LastErrorCode
Localbooleanread/write

If TRUE, the printer is not attached to a network. If both the Local and Network properties are set to TRUE, then the printer is a network printer.

Code
# Value of Local for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Local |
    Select-Object -Property DeviceID, Local

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Local on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Local = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Locationstringread/write

Physical location of the printer.

Example: Bldg. 38, Room 1164

Code
# Value of Location for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Location |
    Select-Object -Property DeviceID, Location

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Location on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Location = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
MarkingTechnologyuint16read

Marking technology the printer uses.

Values (27)
ValueLabelDescription
1Other
2Unknown
3Electrophotographic LED
4Electrophotographic Laser
5Electrophotographic Other
6Impact Moving Head Dot Matrix 9pin
7Impact Moving Head Dot Matrix 24pin
8Impact Moving Head Dot Matrix Other
9Impact Moving Head Fully Formed
10Impact Band
11Impact Other
12Inkjet Aqueous
13Inkjet Solid
14Inkjet Other
15Pen
16Thermal Transfer
17Thermal Sensitive
18Thermal Diffusion
19Thermal Other
20Electroerosion
21Electrostatic
22Photographic Microfiche
23Photographic Imagesetter
24Photographic Other
25Ion Deposition
26eBeam
27Typesetter
Code
# Value of MarkingTechnology for each instance
# Lookup table for MarkingTechnology (values documented by Microsoft)
$markingTechnologyName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Electrophotographic LED'
    4 = 'Electrophotographic Laser'
    5 = 'Electrophotographic Other'
    6 = 'Impact Moving Head Dot Matrix 9pin'
    7 = 'Impact Moving Head Dot Matrix 24pin'
    8 = 'Impact Moving Head Dot Matrix Other'
    9 = 'Impact Moving Head Fully Formed'
    10 = 'Impact Band'
    11 = 'Impact Other'
    12 = 'Inkjet Aqueous'
    13 = 'Inkjet Solid'
    14 = 'Inkjet Other'
    15 = 'Pen'
    16 = 'Thermal Transfer'
    17 = 'Thermal Sensitive'
    18 = 'Thermal Diffusion'
    19 = 'Thermal Other'
    20 = 'Electroerosion'
    21 = 'Electrostatic'
    22 = 'Photographic Microfiche'
    23 = 'Photographic Imagesetter'
    24 = 'Photographic Other'
    25 = 'Ion Deposition'
    26 = 'eBeam'
    27 = 'Typesetter'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, MarkingTechnology |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'MarkingTechnology'; Expression = { $markingTechnologyName[[int]$_.MarkingTechnology] } }
    )
MaxCopiesuint32read

Maximum number of copies the printer can produce for one job.

Code
# Value of MaxCopies for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, MaxCopies |
    Select-Object -Property DeviceID, MaxCopies
MaxNumberUpuint32read

Maximum number of print-stream pages the printer can render on one media sheet, such as paper.

Code
# Value of MaxNumberUp for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, MaxNumberUp |
    Select-Object -Property DeviceID, MaxNumberUp
MaxSizeSupporteduint32read

Largest job as a byte stream, in kilobytes, that the printer can accept. A value of 0 (zero) indicates that no limit is set.

Unit: kilobytes

Code
# Value of MaxSizeSupported for each instance
# MaxSizeSupported is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, MaxSizeSupported |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'MaxSizeSupportedGB'; Expression = { [math]::Round($_.MaxSizeSupported / 1MB, 2) } }
    )
MimeTypesSupportedstring[]read

Array of detailed MIME-type explanations that the printer supports. If data is provided, then the value 47 ("MIME") must be included in the LanguagesSupported property.

Code
# Value of MimeTypesSupported for each instance
# MimeTypesSupported is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property MimeTypesSupported |
    Select-Object -ExpandProperty MimeTypesSupported
Namestringread

Name of the printer.

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Name |
    Select-Object -Property DeviceID, Name
NaturalLanguagesSupportedstring[]read

Array of languages supported for strings that the printer uses for output of management information. Must conform to RFC 1766. For example, "en" is used for English.

Code
# Value of NaturalLanguagesSupported for each instance
# NaturalLanguagesSupported is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property NaturalLanguagesSupported |
    Select-Object -ExpandProperty NaturalLanguagesSupported
Networkbooleanread/write

If TRUE, the printer is a network printer. If both the Local and Network properties are set to TRUE, then the printer is a network printer.

Code
# Value of Network for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Network |
    Select-Object -Property DeviceID, Network

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Network on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Network = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
PaperSizesSupporteduint16[]read

Array of the paper types that the printer supports.

Values (74)
ValueLabelDescription
0Unknown
1Other
2A
3B
4C
5D
6E
7Letter
8Legal
9NA-10x13-Envelope
10NA-9x12-Envelope
11NA-Number-10-Envelope
12NA-7x9-Envelope
13NA-9x11-Envelope
14NA-10x14-Envelope
15NA-Number-9-Envelope
16NA-6x9-Envelope
17NA-10x15-Envelope
18A0
19A1
20A2
21A3
22A4
23A5
24A6
25A7
26A8
27A9A10
28B0
29B1
30B2
31B3
32B4
33B5
34B6
35B7
36B8
37B9
38B10
39C0
40C1
41C2C3C2
42C4C3
43C5C4
44C6C5
45C7C6
46C8C7
47ISO-DesignatedC8
48JIS B0ISO-Designated
49JIS B1JIS B0
50JIS B2JIS B1
51JIS B3JIS B2
52JIS B4JIS B3
53JIS B5JIS B4
54JIS B6JIS B5
55JIS B7JIS B6
56JIS B8JIS B7
57JIS B9JIS B8
58JIS B10JIS B9
59NA-LetterJIS B10
60NA-Legal
61B4-Envelope
62B5-Envelope
63C3-Envelope
64C4-Envelope
65C5-Envelope
66C6-Envelope
67Designated-Long-Envelope
68Monarch-Envelope
69Executive
70Folio
71Invoice
72Ledger
73Quarto
Code
# Value of PaperSizesSupported for each instance
# PaperSizesSupported is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property PaperSizesSupported |
    Select-Object -ExpandProperty PaperSizesSupported
PaperTypesAvailablestring[]read

Array of paper types that are currently available on the printer. Each string must be expressed in the format specified by ISO/IEC 10175 Document Printing Application (DPA), which is summarized in Appendix C of RFC 1759 (Printer MIB). Any paper size identified in this property must also appear in the PaperSizesSupported property.

Example: iso-a4-colored

Code
# Value of PaperTypesAvailable for each instance
# PaperTypesAvailable is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property PaperTypesAvailable |
    Select-Object -ExpandProperty PaperTypesAvailable
Parametersstringread/write

Optional parameters for the print processor.

Example: "Copies=2"

Code
# Value of Parameters for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Parameters |
    Select-Object -Property DeviceID, Parameters

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Parameters on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Parameters = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
PNPDeviceIDstringread

Windows Plug and Play device identifier of the logical device.

Example: *PNP030b

Code
# Value of PNPDeviceID for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PNPDeviceID |
    Select-Object -Property DeviceID, PNPDeviceID
PortNamestringread/write

Port that is used to transmit data to a printer. If a printer is connected to more than one port, the names of each port are separated by commas.

Example: LPT1:, LPT2:, LPT3:

Code
# Value of PortName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PortName |
    Select-Object -Property DeviceID, PortName

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes PortName on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ PortName = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
PowerManagementCapabilitiesuint16[]read

Array of the specific power-related capabilities of a logical device.

Values (8)
ValueLabelDescription
0Unknown
1Not Supported
2Disabled
3EnabledThe power management features are currently enabled, but the exact feature set is unknown or the information is unavailable.
4Power Saving Modes Entered AutomaticallyThe device can change its power state based on usage or other criteria.
5Power State SettableThe SetPowerState method is supported. This method is found on the parent **CIM_LogicalDevice** class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes.
6Power Cycling SupportedThe SetPowerState method can be invoked with the *PowerState* parameter set to 5 (Power Cycle).
7Timed Power On SupportedTimed Power-On Supported The SetPowerState method can be invoked with the *PowerState* parameter set to 5 (Power Cycle) and *Time* set to a specific date and time, or interval, for power-on.
Code
# Value of PowerManagementCapabilities for each instance
# Lookup table for PowerManagementCapabilities (values documented by Microsoft)
$powerManagementCapabilitiesName = @{
    0 = 'Unknown'
    1 = 'Not Supported'
    2 = 'Disabled'
    3 = 'Enabled'
    4 = 'Power Saving Modes Entered Automatically'
    5 = 'Power State Settable'
    6 = 'Power Cycling Supported'
    7 = 'Timed Power On Supported'
}
# PowerManagementCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property PowerManagementCapabilities |
    Select-Object -ExpandProperty PowerManagementCapabilities |
    ForEach-Object -Process { $powerManagementCapabilitiesName[[int]$_] }
PowerManagementSupportedbooleanread

If TRUE, the power of the device can be managed, which means that it can be put into suspend mode. The property does not indicate that power management features are enabled, only that the logical device is capable of power management.

Code
# Value of PowerManagementSupported for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PowerManagementSupported |
    Select-Object -Property DeviceID, PowerManagementSupported
PrinterPaperNamesstring[]read

Array of paper sizes supported by the printer. The printer-specified names are used to represent supported paper sizes.

Example: B5 (JIS)

Code
# Value of PrinterPaperNames for each instance
# PrinterPaperNames is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_Printer -Property PrinterPaperNames |
    Select-Object -ExpandProperty PrinterPaperNames
PrinterStateuint32read

One of the possible states relating to this printer. This property is obsolete. In place of this property, use PrinterStatus.

0

Idle - for more information, see the Remarks section below.

1

Paused

2

Error

3

Pending Deletion

4

Paper Jam

5

Paper Out

6

Manual Feed

7

Paper Problem

8

Offline

9

I/O Active

10

Busy

11

Printing

12

Output Bin Full

13

Not Available

14

Waiting

15

Processing

16

Initialization

17

Warming Up

18

Toner Low

19

No Toner

20

Page Punt

21

User Intervention Required

22

Out of Memory

23

Door Open

24

Server_Unknown

25

Power Save

Code
# Value of PrinterState for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PrinterState |
    Select-Object -Property DeviceID, PrinterState
PrinterStatusuint16read

Status information for a printer that is different from information specified in the logical device Availability property.

Values (7)
ValueLabelDescription
1Other
2Unknown
3IdleIdle - for more information, see the Remarks section below.
4Printing
5WarmupWarming Up
6Stopped Printing
7Offline
Code
# Value of PrinterStatus for each instance
# Lookup table for PrinterStatus (values documented by Microsoft)
$printerStatusName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Idle'
    4 = 'Printing'
    5 = 'Warmup'
    6 = 'Stopped Printing'
    7 = 'Offline'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PrinterStatus |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'PrinterStatus'; Expression = { $printerStatusName[[int]$_.PrinterStatus] } }
    )
PrintJobDataTypestringread/write

Data type of a print job waiting for the Windows-based printing device.

Code
# Value of PrintJobDataType for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PrintJobDataType |
    Select-Object -Property DeviceID, PrintJobDataType

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes PrintJobDataType on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ PrintJobDataType = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
PrintProcessorstringread/write

Name of the print spooler that handles print jobs.

Example: SPOOLSS.DLL

Code
# Value of PrintProcessor for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, PrintProcessor |
    Select-Object -Property DeviceID, PrintProcessor

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes PrintProcessor on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ PrintProcessor = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Priorityuint32read/write

Priority of the printer. Jobs on a higher priority printer are scheduled first.

Code
# Value of Priority for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Priority |
    Select-Object -Property DeviceID, Priority

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Priority on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Priority = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Publishedbooleanread/write

If TRUE, the printer is published in the network directory service.

Code
# Value of Published for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Published |
    Select-Object -Property DeviceID, Published

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Published on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Published = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Queuedbooleanread/write

If TRUE, the printer buffers and queues print jobs.

Code
# Value of Queued for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Queued |
    Select-Object -Property DeviceID, Queued

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Queued on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Queued = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
RawOnlybooleanread/write

If TRUE, the printer accepts only raw data to be spooled.

Code
# Value of RawOnly for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, RawOnly |
    Select-Object -Property DeviceID, RawOnly

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes RawOnly on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ RawOnly = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
SeparatorFilestringread/write

Name of the file used to create a separator page. This page is used to separate print jobs sent to the printer.

Code
# Value of SeparatorFile for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, SeparatorFile |
    Select-Object -Property DeviceID, SeparatorFile

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes SeparatorFile on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ SeparatorFile = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ServerNamestringread

Name of the server that controls the printer. If this string is NULL, the printer is controlled locally.

Code
# Value of ServerName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ServerName |
    Select-Object -Property DeviceID, ServerName
Sharedbooleanread/write

If TRUE, the printer is available as a shared network resource.

Code
# Value of Shared for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Shared |
    Select-Object -Property DeviceID, Shared

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Shared on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ Shared = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ShareNamestringread/write

Share name of the Windows-based printing device.

Example: "\\PRINTSERVER1\PRINTER2"

Code
# Value of ShareName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, ShareName |
    Select-Object -Property DeviceID, ShareName

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes ShareName on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ ShareName = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
SpoolEnabledbooleanread

This property is obsolete; do not use. If TRUE, spooling is enabled for printer.

Code
# Value of SpoolEnabled for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, SpoolEnabled |
    Select-Object -Property DeviceID, SpoolEnabled
StartTimedatetimeread/write

Date and time that a printer can start to print a job—if the printer is limited to print at specific times. This value is expressed as the time elapsed since 12:00 AM GMT (Greenwich Mean Time).

Code
# Value of StartTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, StartTime |
    Select-Object -Property DeviceID, StartTime

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes StartTime on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ StartTime = (Get-Date) }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Statusstringread

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: OK, Degraded, and Pred Fail (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: Error, Starting, Stopping, and Service. The latter, Service, could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither OK nor in one of the other states.

Values include the following:

Values (12)
ValueLabelDescription
OKOK
ErrorError
DegradedDegraded
UnknownUnknown
Pred FailPred Fail
StartingStarting
StoppingStopping
ServiceService
StressedStressed
NonRecoverNonRecover
No ContactNo Contact
Lost CommLost Comm
Code
# Value of Status for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, Status |
    Select-Object -Property DeviceID, Status
StatusInfouint16read

State of the logical device. If this property does not apply to the logical device, the value 5 (Not Applicable) should be used.

Values (5)
ValueLabelDescription
1Other
2Unknown
3Enabled
4Disabled
5Not Applicable
Code
# Value of StatusInfo for each instance
# Lookup table for StatusInfo (values documented by Microsoft)
$statusInfoName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Enabled'
    4 = 'Disabled'
    5 = 'Not Applicable'
}
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, StatusInfo |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'StatusInfo'; Expression = { $statusInfoName[[int]$_.StatusInfo] } }
    )
SystemCreationClassName keystringread

Value of the scoping computer's CreationClassName property.

Code
# Value of SystemCreationClassName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, SystemCreationClassName |
    Select-Object -Property DeviceID, SystemCreationClassName
SystemName keystringread

Name of the scoping system.

Code
# Value of SystemName for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, SystemName |
    Select-Object -Property DeviceID, SystemName
TimeOfLastResetdatetimeread

Date and time the printer was last reset.

Code
# Value of TimeOfLastReset for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, TimeOfLastReset |
    Select-Object -Property DeviceID, TimeOfLastReset
UntilTimedatetimeread/write

Date and time that a printer can print the last job—if the printer is limited to print at specific times. This value is expressed as the time elapsed since 12:00 AM GMT (Greenwich Mean Time).

Code
# Value of UntilTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, UntilTime |
    Select-Object -Property DeviceID, UntilTime

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes UntilTime on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ UntilTime = (Get-Date) }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
VerticalResolutionuint32read

Vertical resolution, in pixels-per-inch, of the printer.

Unit: pixels per inch

Code
# Value of VerticalResolution for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, VerticalResolution |
    Select-Object -Property DeviceID, VerticalResolution
WorkOfflinebooleanread/write

If TRUE, you can queue print jobs on the computer when the printer is offline.

Code
# Value of WorkOffline for each instance
Get-CimInstance -ClassName Win32_Printer -Property DeviceID, WorkOffline |
    Select-Object -Property DeviceID, WorkOffline

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes WorkOffline on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$setParameters = @{
    InputObject = $instance
    Property    = @{ WorkOffline = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters

Methods

AddPrinterConnection #

Adds a connection to the printer.

uint32 AddPrinterConnection([in] string Name);

Parameters

ParameterTypeDirectionDescription
Namestringin

Friendly name for the printer.

Return values

ValueLabelDescription
0Success
5Access Denied
1801Invalid Printer Name
1930Incompatible Printer Driver

Call the AddPrinterConnection method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'AddPrinterConnection'
    Arguments   = @{ Name = 'Example' }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
        1801 = 'Invalid Printer Name'
        1930 = 'Incompatible Printer Driver'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

CancelAllJobs #

Cancels all jobs.

uint32 CancelAllJobs();

Return values

ValueLabelDescription
0Success
5Access Denied

Call the CancelAllJobs method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'CancelAllJobs'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

GetSecurityDescriptor #

Returns the security descriptor that controls access to the printer.

uint32 GetSecurityDescriptor([out] Win32_SecurityDescriptor Descriptor);

Parameters

ParameterTypeDirectionDescription
DescriptorWin32_SecurityDescriptorout

The security descriptor associated with the printer.

Return values

ValueLabelDescription
0Successful completion.
2The user does not have access to the requested information.
8Unknown failure.
9The user does not have adequate privileges to execute the method.
21A parameter specified in the method call is not valid.

Call the GetSecurityDescriptor method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'GetSecurityDescriptor'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Successful completion'
        2 = 'The user does not have access to the requested information'
        8 = 'Unknown failure'
        9 = 'The user does not have adequate privileges to execute the…'
        21 = 'A parameter specified in the method call is not valid'
    }
    $returnValueName[[int]$result.ReturnValue]
    $result.Descriptor
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Pause #

Pauses the print queue.

uint32 Pause();

Return values

ValueLabelDescription
0Success
5Access Denied

Call the Pause method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Pause'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

PrintTestPage #

Prints a test page.

uint32 PrintTestPage();

Return values

ValueLabelDescription
0Success
5Access Denied

Call the PrintTestPage method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'PrintTestPage'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

RenamePrinter #

Renames a printer.

uint32 RenamePrinter([in] string NewPrinterName);

Parameters

ParameterTypeDirectionDescription
NewPrinterNamestringin

New printer name.

Return values

ValueLabelDescription
0Success
5Access Denied
1801Invalid Printer Name

Call the RenamePrinter method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'RenamePrinter'
    Arguments   = @{ NewPrinterName = 'Example' }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
        1801 = 'Invalid Printer Name'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Resume #

Resumes paused print queue.

uint32 Resume();

Return values

ValueLabelDescription
0Success
5Access Denied

Call the Resume method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Resume'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Success'
        5 = 'Access Denied'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

SetDefaultPrinter #

Sets the default printer.

uint32 SetDefaultPrinter();

Call the SetDefaultPrinter method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'SetDefaultPrinter'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

SetSecurityDescriptor #

Writes an updated version of the security descriptor that controls access to the printer.

uint32 SetSecurityDescriptor([in] Win32_SecurityDescriptor Descriptor);

Parameters

ParameterTypeDirectionDescription
DescriptorWin32_SecurityDescriptorin

The security descriptor that is associated with the printer.

Return values

ValueLabelDescription
0Successful completion.
2The user does not have access to the requested information.
8Unknown failure.
9The user does not have adequate privileges to execute the method.
21A parameter specified in the method call is not valid.

Call the SetSecurityDescriptor method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_Printer -Filter "Name = 'Example'"
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'SetSecurityDescriptor'
    Arguments   = @{ Descriptor = $null }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $returnValueName = @{
        0 = 'Successful completion'
        2 = 'The user does not have access to the requested information'
        8 = 'Unknown failure'
        9 = 'The user does not have adequate privileges to execute the…'
        21 = 'A parameter specified in the method call is not valid'
    }
    $returnValueName[[int]$result.ReturnValue]
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Declared but not implemented methods: Reset, SetPowerState.

Remarks

The Win32_Printer class is derived from CIM_Printer. Before calling SWbemObject.Put_ or IWbemServices::PutInstance for a Win32_Printer instance, the SeLoadDriverPrivilege privilege (wbemPrivilegeLoadDriver for Visual Basic and LoadDriver for scripting monikers) must be enabled. For more information, see Privilege Constants and Executing Privileged Operations. The following VBScript code example shows how to enable the SetLoadDriverPrivilege privilege in script.

For working with MSCS Printer clusters, use the prnadmin.dll assembly, or else the .NET Framework System.Printing namespace.

```VB

Set objPrinter = GetObject("winmgmts:{impersonationLevel=Impersonate,(LoadDriver)}!//./Root/CIMv2:Win32_Printer")

```

Windows uses the credentials of the user running the script to determine what the available printers are. Therefore, if you are running a script remotely, you may only be able to access any printer that is available to your user account on that remote system.

You cannot use the Win32_Printer class for printers on an MSCS print cluster. Instead, you may need to use either the PrinterAdmin tool (PrnAdmin.dll) or the .NET Framework System.Printing namespace.

Note: If you are retrieving PrinterStatus = 3 or PrinterState = 0, the printer driver may not be feeding accurate information into WMI. WMI retrieves the printer information from the spoolsv.exe process. It is possible the printer driver does not report its status to the spooler. In this case, Win32_Printer reports the printer as Idle.

Inheritance

Superclass chain

  1. CIM_ManagedSystemElement
  2. CIM_LogicalElement
  3. CIM_LogicalDevice
  4. CIM_Printer
  5. Win32_Printer

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

Source: Microsoft Learn

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.