Szerkesztés

Megosztás a következőn keresztül:


Win32_Printer class

The Win32_Printer WMI class 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.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

class Win32_Printer : CIM_Printer
{
  uint32   Attributes;
  uint16   Availability;
  string   AvailableJobSheets[];
  uint32   AveragePagesPerMinute;
  uint16   Capabilities[];
  string   CapabilityDescriptions[];
  string   Caption;
  string   CharSetsSupported[];
  string   Comment;
  uint32   ConfigManagerErrorCode;
  boolean  ConfigManagerUserConfig;
  string   CreationClassName;
  uint16   CurrentCapabilities[];
  string   CurrentCharSet;
  uint16   CurrentLanguage;
  string   CurrentMimeType;
  string   CurrentNaturalLanguage;
  string   CurrentPaperType;
  boolean  Default;
  uint16   DefaultCapabilities[];
  uint32   DefaultCopies;
  uint16   DefaultLanguage;
  string   DefaultMimeType;
  uint32   DefaultNumberUp;
  string   DefaultPaperType;
  uint32   DefaultPriority;
  string   Description;
  uint16   DetectedErrorState;
  string   DeviceID;
  boolean  Direct;
  boolean  DoCompleteFirst;
  string   DriverName;
  boolean  EnableBIDI;
  boolean  EnableDevQueryPrint;
  boolean  ErrorCleared;
  string   ErrorDescription;
  string   ErrorInformation[];
  uint16   ExtendedDetectedErrorState;
  uint16   ExtendedPrinterStatus;
  boolean  Hidden;
  uint32   HorizontalResolution;
  datetime InstallDate;
  uint32   JobCountSinceLastReset;
  boolean  KeepPrintedJobs;
  uint16   LanguagesSupported[];
  uint32   LastErrorCode;
  boolean  Local;
  string   Location;
  uint16   MarkingTechnology;
  uint32   MaxCopies;
  uint32   MaxNumberUp;
  uint32   MaxSizeSupported;
  string   MimeTypesSupported[];
  string   Name;
  string   NaturalLanguagesSupported[];
  boolean  Network;
  uint16   PaperSizesSupported[];
  string   PaperTypesAvailable[];
  string   Parameters;
  string   PNPDeviceID;
  string   PortName;
  uint16   PowerManagementCapabilities[];
  boolean  PowerManagementSupported;
  string   PrinterPaperNames[];
  uint32   PrinterState;
  uint16   PrinterStatus;
  string   PrintJobDataType;
  string   PrintProcessor;
  uint32   Priority;
  boolean  Published;
  boolean  Queued;
  boolean  RawOnly;
  string   SeparatorFile;
  string   ServerName;
  boolean  Shared;
  string   ShareName;
  boolean  SpoolEnabled;
  datetime StartTime;
  string   Status;
  uint16   StatusInfo;
  string   SystemCreationClassName;
  string   SystemName;
  datetime TimeOfLastReset;
  datetime UntilTime;
  uint32   VerticalResolution;
  boolean  WorkOffline;
};

Members

The Win32_Printer class has these types of members:

Methods

The Win32_Printer class has these methods.

Method Description
AddPrinterConnection Adds a connection to the printer.
CancelAllJobs Cancels all jobs.
GetSecurityDescriptor Returns the security descriptor that controls access to the printer.
Pause Pauses the print queue.
PrintTestPage Prints a test page.
RenamePrinter Renames a printer.
Reset Not implemented. For more information about how to implement this method, see the Reset method in CIM_Printer.
Resume Resumes paused print queue.
SetDefaultPrinter Sets the default printer.
SetPowerState Not implemented. For more information about how to implement this method, see the SetPowerState method in CIM_Printer.
SetSecurityDescriptor Writes an updated version of the security descriptor that controls access to the printer.

 

Properties

The Win32_Printer class has these properties.

Attributes

Data type: uint32

Access type: Read-only

Bitmap of attributes for a Windows-based printing device.

PRINTER_ATTRIBUTE_QUEUED (1 (0x1))

Queued

Print jobs are buffered and queued.

PRINTER_ATTRIBUTE_DIRECT (2 (0x2))

Direct

Document to be sent directly to the printer. This value is used if print jobs are not queued correctly.

PRINTER_ATTRIBUTE_DEFAULT (4 (0x4))

Default

Default printer on a computer.

PRINTER_ATTRIBUTE_SHARED (8 (0x8))

Shared

Available as a shared network resource.

PRINTER_ATTRIBUTE_NETWORK (16 (0x10))

Network

Attached to a network. If both Local and Network bits are set, this indicates a network printer.

PRINTER_ATTRIBUTE_HIDDEN (32 (0x20))

Hidden

Hidden from some users on the network.

PRINTER_ATTRIBUTE_LOCAL (64 (0x40))

Local

Directly connected to a computer. If both Local and Network bits are set, this indicates a network printer.

PRINTER_ATTRIBUTE_ENABLEDEVQ (128 (0x80))

EnableDevQ

Enable the queue on the printer if available.

PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS (256 (0x100))

KeepPrintedJobs

Spooler should not delete documents after they are printed.

PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST (512 (0x200))

DoCompleteFirst

Start jobs that are finished spooling first.

PRINTER_ATTRIBUTE_WORK_OFFLINE (1024 (0x400))

WorkOffline

Queue print jobs when a printer is not available.

PRINTER_ATTRIBUTE_ENABLE_BIDI (2048 (0x800))

EnableBIDI

Enable bidirectional printing.

PRINTER_ATTRIBUTE_RAW_ONLY (4096 (0x1000))

Allow only raw data type jobs to be spooled.

PRINTER_ATTRIBUTE_PUBLISHED (8192 (0x2000))

Published

Published in the network directory service.

Availability

Data type: uint16

Access type: Read-only

Qualifiers: MappingStrings ("MIF.DMTF|Operational State|003.5", "MIB.IETF|HOST-RESOURCES-MIB.hrDeviceStatus")

Availability and status of the device.

This property is inherited from CIM_LogicalDevice.

Other (1)

Unknown (2)

Running/Full Power (3)

Running or Full Power

Warning (4)

In Test (5)

Not Applicable (6)

Power Off (7)

Off Line (8)

Off Duty (9)

Degraded (10)

Not Installed (11)

Install Error (12)

Power Save - Unknown (13)

The device is known to be in a power save mode, but its exact status is unknown.

Power Save - Low Power Mode (14)

The device is in a power save state but is still functioning, and may exhibit degraded performance.

Power Save - Standby (15)

The device is not functioning, but could be brought to full power quickly.

Power Cycle (16)

Power Save - Warning (17)

The device is in a warning state, though also in a power save mode.

Paused (18)

The device is paused.

Not Ready (19)

The device is not ready.

Not Configured (20)

The device is not configured.

Quiesced (21)

The device is quiet.

AvailableJobSheets

Data type: string array

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.RequiredJobSheets")

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.

This property is inherited from CIM_Printer.

AveragePagesPerMinute

Data type: uint32

Access type: Read-only

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

Capabilities

Data type: uint16 array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_Printer.CapabilityDescriptions", "CIM_PrintJob.Finishing", "CIM_PrintService.Capabilities")

Array of printer capabilities.

This property is inherited from CIM_Printer.

Unknown (0)

Other (1)

Color Printing (2)

Duplex Printing (3)

Copies (4)

Collation (5)

Stapling (6)

Transparency Printing (7)

Punch (8)

Cover (9)

Bind (10)

Black and White Printing (11)

One Sided (12)

One-Sided

Two Sided Long Edge (13)

Two-Sided Long Edge

Two Sided Short Edge (14)

Two-Sided Short Edge

Portrait (15)

Landscape (16)

Reverse Portrait (17)

Reverse Landscape (18)

Quality High (19)

Quality Normal (20)

Quality Low (21)

CapabilityDescriptions

Data type: string array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_Printer.Capabilities")

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.

This property is inherited from CIM_Printer.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64), DisplayName ("Caption")

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

This property is inherited from CIM_ManagedSystemElement.

CharSetsSupported

Data type: string array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_PrintJob.CharSet"), MappingStrings ("MIB.IETF|Printer-MIB.prtLocalizationCharacterSet")

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".

This property is inherited from CIM_Printer.

Comment

Data type: string

Access type: Read/write

Comment for a print queue.

Example: Color printer

ConfigManagerErrorCode

Data type: uint32

Access type: Read-only

Qualifiers: Schema ("Win32")

Win32 Configuration Manager error code.

This property is inherited from CIM_LogicalDevice.

This device is working properly. (0)

Device is working properly.

This device is not configured correctly. (1)

Device is not configured correctly.

Windows cannot load the driver for this device. (2)

The driver for this device might be corrupted, or your system may be running low on memory or other resources. (3)

Driver for this device might be corrupted, or the system may be low on memory or other resources.

This device is not working properly. One of its drivers or your registry might be corrupted. (4)

Device is not working properly. One of its drivers or the registry might be corrupted.

The driver for this device needs a resource that Windows cannot manage. (5)

Driver for the device requires a resource that Windows cannot manage.

The boot configuration for this device conflicts with other devices. (6)

Boot configuration for the device conflicts with other devices.

Cannot filter. (7)

The driver loader for the device is missing. (8)

Driver loader for the device is missing.

This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly. (9)

Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.

This device cannot start. (10)

Device cannot start.

This device failed. (11)

Device failed.

This device cannot find enough free resources that it can use. (12)

Device cannot find enough free resources to use.

Windows cannot verify this device's resources. (13)

Windows cannot verify the device's resources.

This device cannot work properly until you restart your computer. (14)

Device cannot work properly until the computer is restarted.

This device is not working properly because there is probably a re-enumeration problem. (15)

Device is not working properly due to a possible re-enumeration problem.

Windows cannot identify all the resources this device uses. (16)

Windows cannot identify all of the resources that the device uses.

This device is asking for an unknown resource type. (17)

Device is requesting an unknown resource type.

Reinstall the drivers for this device. (18)

Device drivers must be reinstalled.

Failure using the VxD loader. (19)

Your registry might be corrupted. (20)

Registry might be corrupted.

System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device. (21)

System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.

This device is disabled. (22)

Device is disabled.

System failure: Try changing the driver for this device. If that doesn't work, see your hardware documentation. (23)

System failure. If changing the device driver is ineffective, see the hardware documentation.

This device is not present, is not working properly, or does not have all its drivers installed. (24)

Device is not present, not working properly, or does not have all of its drivers installed.

Windows is still setting up this device. (25)

Windows is still setting up the device.

Windows is still setting up this device. (26)

Windows is still setting up the device.

This device does not have valid log configuration. (27)

Device does not have a valid log configuration.

The drivers for this device are not installed. (28)

Device drivers are not installed.

This device is disabled because the firmware of the device did not give it the required resources. (29)

Device is disabled. The device firmware did not provide the required resources.

This device is using an Interrupt Request (IRQ) resource that another device is using. (30)

Device is using an IRQ resource that another device is using.

This device is not working properly because Windows cannot load the drivers required for this device. (31)

Device is not working properly. Windows cannot load the required device drivers.

ConfigManagerUserConfig

Data type: boolean

Access type: Read-only

Qualifiers: Schema ("Win32")

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

This property is inherited from CIM_LogicalDevice.

CreationClassName

Data type: string

Access type: Read-only

Qualifiers: CIM_Key

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.

This property is inherited from CIM_LogicalDevice.

CurrentCapabilities

Data type: uint16 array

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.Capabilities")

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

This property is inherited from CIM_Printer.

Unknown (0)

Other (1)

Color Printing (2)

Duplex Printing (3)

Copies (4)

Collation (5)

Stapling (6)

Transparency Printing (7)

Punch (8)

Cover (9)

Bind (10)

Black and White Printing (11)

One Sided (12)

One-Sided

Two Sided Long Edge (13)

Two-Sided Long Edge

Two Sided Short Edge (14)

Two-Sided Short Edge

Portrait (15)

Landscape (16)

Reverse Portrait (17)

Reverse Landscape (18)

Quality High (19)

Quality Normal (20)

Quality Low (21)

CurrentCharSet

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.CharSetsSupported")

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.

This property is inherited from CIM_Printer.

CurrentLanguage

Data type: uint16

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.LanguagesSupported", "CIM_Printer.CurrentMimeType")

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

This property is inherited from CIM_Printer.

Other (1)

Unknown (2)

PCL (3)

HPGL (4)

PJL (5)

PS (6)

PSPrinter (7)

IPDS (8)

PPDS (9)

EscapeP (10)

Epson (11)

DDIF (12)

Interpress (13)

ISO6429 (14)

Line Data (15)

LineData

MODCA (16)

DODCA

REGIS (17)

SCS (18)

SPDL (19)

TEK4014 (20)

PDS (21)

IGP (22)

CodeV (23)

DSCDSE (24)

WPS (25)

LN03 (26)

CCITT (27)

QUIC (28)

CPAP (29)

DecPPL (30)

Simple Text (31)

SimpleText

NPAP (32)

DOC (33)

imPress (34)

Pinwriter (35)

NPDL (36)

NEC201PL (37)

Automatic (38)

Pages (39)

LIPS (40)

TIFF (41)

Diagnostic (42)

CaPSL (43)

EXCL (44)

LCDS (45)

XES (46)

MIME (47)

48

XPS

49

HPGL2

50

PCLXL

CurrentMimeType

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.CurrentLanguage")

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

This property is inherited from CIM_Printer.

CurrentNaturalLanguage

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.NaturalLanguagesSupported")

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

This property is inherited from CIM_Printer.

CurrentPaperType

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.PaperTypesAvailable")

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).

This property is inherited from CIM_Printer.

Default

Data type: boolean

Access type: Read-only

If TRUE, the printer is the default printer.

DefaultCapabilities

Data type: uint16 array

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.Capabilities")

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

This property is inherited from CIM_Printer.

Unknown (0)

Other (1)

Color Printing (2)

Duplex Printing (3)

Copies (4)

Collation (5)

Stapling (6)

Transparency Printing (7)

Punch (8)

Cover (9)

Bind (10)

Black and White Printing (11)

One Sided (12)

One-Sided

Two Sided Long Edge (13)

Two-Sided Long Edge

Two Sided Short Edge (14)

Two-Sided Short Edge

Portrait (15)

Landscape (16)

Reverse Portrait (17)

Reverse Landscape (18)

Quality High (19)

Quality Normal (20)

Quality Low (21)

DefaultCopies

Data type: uint32

Access type: Read-only

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

This property is inherited from CIM_Printer.

DefaultLanguage

Data type: uint16

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.LanguagesSupported", "CIM_Printer.DefaultMimeType")

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

This property is inherited from CIM_Printer.

Other (1)

Unknown (2)

PCL (3)

HPGL (4)

PJL (5)

PS (6)

PSPrinter (7)

IPDS (8)

PPDS (9)

EscapeP (10)

Epson (11)

DDIF (12)

Interpress (13)

ISO6429 (14)

Line Data (15)

LineData

MODCA (16)

DODCA

REGIS (17)

SCS (18)

SPDL (19)

TEK4014 (20)

PDS (21)

IGP (22)

CodeV (23)

DSCDSE (24)

WPS (25)

LN03 (26)

CCITT (27)

QUIC (28)

CPAP (29)

DecPPL (30)

Simple Text (31)

SimpleText

NPAP (32)

DOC (33)

imPress (34)

Pinwriter (35)

NPDL (36)

NEC201PL (37)

Automatic (38)

Pages (39)

LIPS (40)

TIFF (41)

Diagnostic (42)

CaPSL (43)

EXCL (44)

LCDS (45)

XES (46)

MIME (47)

48

XPS

49

HPGL2

50

PCLXL

DefaultMimeType

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.DefaultLanguage")

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

This property is inherited from CIM_Printer.

DefaultNumberUp

Data type: uint32

Access type: Read-only

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

This property is inherited from CIM_Printer.

DefaultPaperType

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.PaperTypesAvailable")

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).

This property is inherited from CIM_Printer.

DefaultPriority

Data type: uint32

Access type: Read/write

Default priority value assigned to each print job.

Description

Data type: string

Access type: Read-only

Qualifiers: DisplayName ("Description")

Description of an object.

This property is inherited from CIM_ManagedSystemElement.

DetectedErrorState

Data type: uint16

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.ErrorInformation"), MappingStrings ("MIB.IETF|Printer-MIB.hrPrinterDetectedErrorState")

Printer error information.

This property is inherited from CIM_Printer.

Unknown (0)

Other (1)

No Error (2)

Low Paper (3)

No Paper (4)

Low Toner (5)

No Toner (6)

Door Open (7)

Jammed (8)

Offline (9)

Service Requested (10)

Output Bin Full (11)

DeviceID

Data type: string

Access type: Read-only

Qualifiers: CIM_Key

Unique identifier of the printer on a system.

This property is inherited from CIM_LogicalDevice.

Direct

Data type: boolean

Access type: Read/write

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

DoCompleteFirst

Data type: boolean

Access type: Read/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.

DriverName

Data type: string

Access type: Read/write

Name of the Windows printer driver.

Example: Windows Fax Driver

EnableBIDI

Data type: boolean

Access type: Read/write

If TRUE, the printer can print bidirectionally.

EnableDevQueryPrint

Data type: boolean

Access type: Read/write

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

ErrorCleared

Data type: boolean

Access type: Read-only

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

This property is inherited from CIM_LogicalDevice.

ErrorDescription

Data type: string

Access type: Read-only

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

This property is inherited from CIM_LogicalDevice.

ErrorInformation

Data type: string array

Access type: Read/write

Qualifiers: ModelCorrespondence ("CIM_Printer.DetectedErrorState")

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

This property is inherited from CIM_Printer.

ExtendedDetectedErrorState

Data type: uint16

Access type: Read-only

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

Values are:

0 (0x0)

Unknown

1 (0x1)

Other

2 (0x2)

No Error

3 (0x3)

Low Paper

4 (0x4)

No Paper

5 (0x5)

Low Toner

6 (0x6)

No Toner

7 (0x7)

Door Open

8 (0x8)

Jammed

9 (0x9)

Service Requested

10 (0xA)

Output Bin Full

11 (0xB)

Paper Problem

12 (0xC)

Cannot Print Page

13 (0xD)

User Intervention Required

14 (0xE)

Out of Memory

15 (0xF)

Server Unknown

ExtendedPrinterStatus

Data type: uint16

Access type: Read-only

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

1 (0x1)

Other

2 (0x2)

Unknown

3 (0x3)

Idle

4 (0x4)

Printing

5 (0x5)

Warming Up

6 (0x6)

Stopped Printing

7

Offline

8 (0x8)

Paused

9 (0x9)

Error

10 (0xA)

Busy

11 (0xB)

Not Available

12 (0xC)

Waiting

13 (0xD)

Processing

14 (0xE)

Initialization

15

Power Save

16 (0x10)

Pending Deletion

17 (0x11)

I/O Active

18 (0x12)

Manual Feed

Hidden

Data type: boolean

Access type: Read/write

If TRUE, the printer is hidden from network users.

HorizontalResolution

Data type: uint32

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.HorizontalResolution"), Units ("pixels per inch")

Horizontal resolution of the printer—in pixels per inch.

This property is inherited from CIM_Printer.

InstallDate

Data type: datetime

Access type: Read-only

Qualifiers: MappingStrings ("MIF.DMTF|ComponentID|001.5"), DisplayName ("Install Date")

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.

JobCountSinceLastReset

Data type: uint32

Access type: Read-only

Qualifiers: Counter

Number of print jobs since the printer was last reset.

This property is inherited from CIM_Printer.

KeepPrintedJobs

Data type: boolean

Access type: Read/write

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

LanguagesSupported

Data type: uint16 array

Access type: Read-only

Qualifiers: MappingStrings ("MIB.IETF|Printer-MIB.prtInterpreterLangFamily"), ModelCorrespondence ("CIM_Printer.MimeTypesSupported", "CIM_PrintJob.Language", "CIM_PrintService.LanguagesSupported")

Array of the print languages natively supported.

This property is inherited from CIM_Printer.

Other (1)

Unknown (2)

PCL (3)

HPGL (4)

PJL (5)

PS (6)

PSPrinter (7)

IPDS (8)

PPDS (9)

EscapeP (10)

Epson (11)

DDIF (12)

Interpress (13)

ISO6429 (14)

Line Data (15)

LineData

MODCA (16)

DODCA

REGIS (17)

SCS (18)

SPDL (19)

TEK4014 (20)

PDS (21)

IGP (22)

CodeV (23)

DSCDSE (24)

WPS (25)

LN03 (26)

CCITT (27)

QUIC (28)

CPAP (29)

DecPPL (30)

Simple Text (31)

SimpleText

NPAP (32)

DOC (33)

imPress (34)

Pinwriter (35)

NPDL (36)

NEC201PL (37)

Automatic (38)

Pages (39)

LIPS (40)

TIFF (41)

Diagnostic (42)

CaPSL (43)

EXCL (44)

LCDS (45)

XES (46)

MIME (47)

XPS (48)

HPGL2 (49)

PCLXL (50)

LastErrorCode

Data type: uint32

Access type: Read-only

Last error code that the logical device reports.

This property is inherited from CIM_LogicalDevice.

Local

Data type: boolean

Access type: Read/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.

Location

Data type: string

Access type: Read/write

Physical location of the printer.

Example: Bldg. 38, Room 1164

MarkingTechnology

Data type: uint16

Access type: Read-only

Qualifiers: MappingStrings ("MIB.IETF|Printer-MIB.prtMarkerMarkTech")

Marking technology the printer uses.

This property is inherited from CIM_Printer.

Other (1)

Unknown (2)

Electrophotographic LED (3)

Electrophotographic Laser (4)

Electrophotographic Other (5)

Impact Moving Head Dot Matrix 9pin (6)

Impact Moving Head Dot Matrix 24pin (7)

Impact Moving Head Dot Matrix Other (8)

Impact Moving Head Fully Formed (9)

Impact Band (10)

Impact Other (11)

Inkjet Aqueous (12)

Inkjet Solid (13)

Inkjet Other (14)

Pen (15)

Thermal Transfer (16)

Thermal Sensitive (17)

Thermal Diffusion (18)

Thermal Other (19)

Electroerosion (20)

Electrostatic (21)

Photographic Microfiche (22)

Photographic Imagesetter (23)

Photographic Other (24)

Ion Deposition (25)

eBeam (26)

Typesetter (27)

MaxCopies

Data type: uint32

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.Copies")

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

This property is inherited from CIM_Printer.

MaxNumberUp

Data type: uint32

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.NumberUp")

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

This property is inherited from CIM_Printer.

MaxSizeSupported

Data type: uint32

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.JobSize"), Units ("kilobytes")

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

This property is inherited from CIM_Printer.

MimeTypesSupported

Data type: string array

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Printer.LanguagesSupported", "CIM_PrintJob.MimeTypes", "CIM_PrintService.MimeTypesSupported")

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.

This property is inherited from CIM_Printer.

Name

Data type: string

Access type: Read-only

Qualifiers: DisplayName ("Name")

Name of the printer.

This property is inherited from CIM_ManagedSystemElement.

NaturalLanguagesSupported

Data type: string array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), MappingStrings ("MIB.IETF|Printer-MIB.prtLocalizationLanguage"), ModelCorrespondence ("CIM_PrintJob.NaturalLanguage")

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.

This property is inherited from CIM_Printer.

Network

Data type: boolean

Access type: Read/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.

PaperSizesSupported

Data type: uint16 array

Access type: Read-only

Array of the paper types that the printer supports.

This property is inherited from CIM_Printer.

Unknown (0)

Other (1)

A (2)

B (3)

C (4)

D (5)

E (6)

Letter (7)

Legal (8)

NA-10x13-Envelope (9)

NA-9x12-Envelope (10)

NA-Number-10-Envelope (11)

NA-7x9-Envelope (12)

NA-9x11-Envelope (13)

NA-10x14-Envelope (14)

NA-Number-9-Envelope (15)

NA-6x9-Envelope (16)

NA-10x15-Envelope (17)

A0 (18)

A1 (19)

A2 (20)

A3 (21)

A4 (22)

A5 (23)

A6 (24)

A7 (25)

A8 (26)

A9A10 (27)

B0 (28)

B1 (29)

B2 (30)

B3 (31)

B4 (32)

B5 (33)

B6 (34)

B7 (35)

B8 (36)

B9 (37)

B10 (38)

C0 (39)

C1 (40)

C2C3 (41)

C2

C4 (42)

C3

C5 (43)

C4

C6 (44)

C5

C7 (45)

C6

C8 (46)

C7

ISO-Designated (47)

C8

JIS B0 (48)

ISO-Designated

JIS B1 (49)

JIS B0

JIS B2 (50)

JIS B1

JIS B3 (51)

JIS B2

JIS B4 (52)

JIS B3

JIS B5 (53)

JIS B4

JIS B6 (54)

JIS B5

JIS B7 (55)

JIS B6

JIS B8 (56)

JIS B7

JIS B9 (57)

JIS B8

JIS B10 (58)

JIS B9

NA-Letter (59)

JIS B10

NA-Legal (60)

B4-Envelope (61)

B5-Envelope (62)

C3-Envelope (63)

C4-Envelope (64)

C5-Envelope (65)

C6-Envelope (66)

Designated-Long-Envelope (67)

Monarch-Envelope (68)

Executive (69)

Folio (70)

Invoice (71)

Ledger (72)

Quarto (73)

PaperTypesAvailable

Data type: string array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_PrintJob.RequiredPaperType", "CIM_PrintService.PaperTypesAvailable"), MappingStrings ("MIB.IETF|Printer-MIB.prtInputMediaName")

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.

This property is inherited from CIM_Printer.

Example: iso-a4-colored

Parameters

Data type: string

Access type: Read/write

Optional parameters for the print processor.

Example: "Copies=2"

PNPDeviceID

Data type: string

Access type: Read-only

Qualifiers: Schema ("Win32")

Windows Plug and Play device identifier of the logical device.

This property is inherited from CIM_LogicalDevice.

Example: *PNP030b

PortName

Data type: string

Access type: Read/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:

PowerManagementCapabilities

Data type: uint16 array

Access type: Read-only

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

This property is inherited from CIM_LogicalDevice.

Unknown (0)

Not Supported (1)

Disabled (2)

Enabled (3)

The power management features are currently enabled, but the exact feature set is unknown or the information is unavailable.

Power Saving Modes Entered Automatically (4)

The device can change its power state based on usage or other criteria.

Power State Settable (5)

The 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.

Power Cycling Supported (6)

The SetPowerState method can be invoked with the PowerState parameter set to 5 (Power Cycle).

Timed Power On Supported (7)

Timed 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.

PowerManagementSupported

Data type: boolean

Access type: Read-only

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.

This property is inherited from CIM_LogicalDevice.

PrinterPaperNames

Data type: string array

Access type: Read-only

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

Example: B5 (JIS)

PrinterState

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

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

PrinterStatus

Data type: uint16

Access type: Read-only

Qualifiers: MappingStrings ("MIB.IETF|Printer-MIB.hrPrinterStatus")

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

This property is inherited from CIM_Printer.

Other (1)

Unknown (2)

Idle (3)

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

Printing (4)

Warmup (5)

Warming Up

Stopped Printing (6)

Offline (7)

PrintJobDataType

Data type: string

Access type: Read/write

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

PrintProcessor

Data type: string

Access type: Read/write

Name of the print spooler that handles print jobs.

Example: SPOOLSS.DLL

Priority

Data type: uint32

Access type: Read/write

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

Published

Data type: boolean

Access type: Read/write

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

Queued

Data type: boolean

Access type: Read/write

If TRUE, the printer buffers and queues print jobs.

RawOnly

Data type: boolean

Access type: Read/write

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

SeparatorFile

Data type: string

Access type: Read/write

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

ServerName

Data type: string

Access type: Read-only

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

Shared

Data type: boolean

Access type: Read/write

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

ShareName

Data type: string

Access type: Read/write

Share name of the Windows-based printing device.

Example: "\\PRINTSERVER1\PRINTER2"

SpoolEnabled

Data type: boolean

Access type: Read-only

Qualifiers: Deprecated

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

StartTime

Data type: datetime

Access type: Read/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).

Status

Data type: string

Access type: Read-only

Qualifiers: MaxLen (10), DisplayName ("Status")

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.

This property is inherited from CIM_ManagedSystemElement.

Values include the following:

OK ("OK")

Error ("Error")

Degraded ("Degraded")

Unknown ("Unknown")

Pred Fail ("Pred Fail")

Starting ("Starting")

Stopping ("Stopping")

Service ("Service")

Stressed ("Stressed")

NonRecover ("NonRecover")

No Contact ("No Contact")

Lost Comm ("Lost Comm")

StatusInfo

Data type: uint16

Access type: Read-only

Qualifiers: MappingStrings ("MIF.DMTF|Operational State|003.3")

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

This property is inherited from CIM_LogicalDevice.

Other (1)

Unknown (2)

Enabled (3)

Disabled (4)

Not Applicable (5)

SystemCreationClassName

Data type: string

Access type: Read-only

Qualifiers: Propagated ("CIM_System.CreationClassName"), CIM_Key

Value of the scoping computer's CreationClassName property.

This property is inherited from CIM_LogicalDevice.

SystemName

Data type: string

Access type: Read-only

Qualifiers: Propagated ("CIM_System.Name"), CIM_Key

Name of the scoping system.

This property is inherited from CIM_LogicalDevice.

TimeOfLastReset

Data type: datetime

Access type: Read-only

Date and time the printer was last reset.

This property is inherited from CIM_Printer.

UntilTime

Data type: datetime

Access type: Read/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).

VerticalResolution

Data type: uint32

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_PrintJob.HorizontalResolution"), Units ("pixels per inch")

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

This property is inherited from CIM_Printer.

WorkOffline

Data type: boolean

Access type: Read/write

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

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.

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.

 

Examples

The following PowerShell code sample shows how to determine the default printer of the local computer.

Get-WmiObject win32_printer | %{if ($_.default) {$_}}

The following VBScript code sample describes how to retrieve printer stats from instances of Win32_Printer.

Set PrinterSet = GetObject("winmgmts:").InstancesOf ("Win32_Printer")
If (PrinterSet.Count = 0 ) Then WScript.Echo "No Printers Installed!"
for each Printer in PrinterSet
   if Printer.PrinterStatus = 3 then WScript.Echo Printer.Name & Chr(13) & "Status:  Idle"
   if Printer.PrinterStatus = 4 then WScript.Echo Printer.Name & Chr(13) & "Status:  Printing"
   
next

The following Perl code sample describes how to retrieve printer stats from instances of Win32_Printer.

use strict;
use Win32::OLE;

my $PrinterSet;

eval { $PrinterSet = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2")->
   InstancesOf ("Win32_Printer"); };
unless($@)
{
   if ($PrinterSet->{Count} == 0) 
   {
      print "No Printers Installed!\n";
   }

   foreach my $PrinterInst (in $PrinterSet)
   {
      if ($PrinterInst->{PrinterStatus} == 3) 
      {
         print "\n$PrinterInst->{Name}\nStatus:  Idle\n";
      }
      if ($PrinterInst->{PrinterStatus} == 4) 
      {
         print "\n$PrinterInst->{Name}\nStatus:  Printing\n";
      }
   }
}
else
{
   print STDERR Win32::OLE->LastError, "\n";
}

The following VBScript code example shows how to obtain the name of the default printer for a computer.

strComputer = "."
Set objWMIService = GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\Root\CIMv2")
Set colInstalledPrinters =  objWMIService.ExecQuery ("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters

    If objPrinter.Default = "True" Then 
      Wscript.Echo "Name: " & objPrinter.Name
    End If
Next

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
Win32_Printer.mof
DLL
CIMWin32.dll

See also

CIM_Printer

Computer System Hardware Classes

WMI Tasks: Printers and Printing