Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Like most management activities, print management requires a detailed understanding of the capabilities of each element in the infrastructure. As an administrator, you must ensure that users have access to printers, and to the right kind of printers. Graphic artists, for example, have very different printing needs than word processor operators. Users who prepare large monthly reports likely require a much faster printer than users who occasionally print a memo or two.
When planning the distribution of print resources to meet these needs, you must take into account the capabilities of those resources. For example, printers that cannot collate and staple documents should not be placed in locations where collating and stapling are required.
You can use two WMI classes, Win32_Printer and Win32_PrinterConfiguration, to return information about all the printers installed on a given print server. This information includes the subset of Win32_Printer properties shown in Table 13.5.
Table 13.5 Win32_Printer Properties
Property | Description |
---|---|
Capabilities | Array of printer capabilities. Values include the following: 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 |
CapabilityDescriptions | Array of free-form strings providing more detailed explanations for any of the printer features indicated in the Capabilities array. Each entry in this array is related to the entry in the Capabilities array that is located at the same index. |
Description | Description of the printer. |
DeviceID | Unique identifier of the printer, used to distinguish it from other devices on the system. |
DriverName | Name of the printer driver. |
Location | Physical location of the printer. |
Name | Label by which the printer is known. |
PortName | Port that can be used to transmit data to the printer. If a printer is connected to more than one port, the names of the ports are separated by commas. |
SeparatorFile | Name of the file used to create a separator page. |
ServerName | Name of the server that controls the printer. |
ShareName | Share name of the printer. |
StartTime | Earliest date and time the printer can print a job (if the printer has been configured to print only at certain times). This value is expressed as time elapsed since 12:00 A.M. GMT (Greenwich mean time). |
TimeOfLastReset | Date and time this printer was last reset. |
UntilTime | Latest date and time the printer can print a job (if the printer has been limited to print only at certain times). This value is expressed as time elapsed since 12:00 A.M. GMT (Greenwich mean time). |
Additional properties available through the Win32_PrinterConfiguration class are listed in Table 13.6. Many of these properties represent the default values that are assigned to all print jobs sent to the printer. For example, if the Copies property is set to 2, by default the printer will print two copies of each print job. Users can override these default values by changing the appropriate options in the Print dialog box each time they print a document.
Table 13.6 Win32_PrinterConfiguration Properties
Property | Description |
---|---|
Collate | Boolean value indicating whether the pages that are printed should be collated. This property is ignored if the printer driver does not support collation. |
Color | Method used by a color printer to print a black-and-white document. Some color printers have the capability to print using true black instead of a combination of cyan, magenta, and yellow (CMY). This usually creates darker and sharper text for documents. This option is useful only for color printers that support true black printing. Values include the following: 1 Monochrome (true black) 2 Color (CMY) |
Copies | Number of copies to be printed. |
DeviceName | Friendly name of the printer. |
DriverVersion | Version number of the printer driver. Version numbers are created and maintained by the driver manufacturer. |
Duplex | Boolean value indicating whether printing is done on both sides (True) or only one side of the medium (False). |
HorizontalResolution | Print resolution in dots per inch for the width of the print job. This value is set only when the PrintQuality property is positive. |
Name | Name of the printer. |
Orientation | Printing orientation of the paper. Values include the following: 1 Portrait 2 Landscape |
PaperLength | Length of the paper (in tenths of a millimeter). To determine the size of the paper in inches, divide this value by 254. |
PaperSize | Size of the paper. |
PaperWidth | Width of the paper (in tenths of a millimeter). To determine the size of the paper in inches, divide this value by 254. |
PrintQuality | One of four quality levels of the print job. If a positive value is specified, the quality is measured in dots per inch. Values include the following: 1 Draft 2 Low 3 Medium 4 High |
Scale | Factor by which the printed output is to be scaled. For example, a scale of 75 reduces the print output to 3/4 its original height and width. |
SpecificationVersion | Version number of the initialization data for the device associated with the printer. |
TTOption | Indicates the manner in which TrueType fonts should be printed. Values include the following: 1 Bitmap Prints TrueType fonts as graphics. This is the default action for dot-matrix printers. 2 Download Downloads TrueType fonts as soft fonts. This is the default action for printers that use the Printer Control Language (PCL). 3 Substitute Substitutes device fonts for TrueType fonts. This is the default action for PostScript printers. |
VerticalResolution | Print resolution for the height of the print job. This value is set only when the PrintQuality property is positive. |
The IADsPrintQueue interface can also return information about a printer. Selected properties, all of which are read/write, available through this interface are shown in Table 13.7.
Table 13.7 IADsPrintQueue Properties
Property | Description |
---|---|
BannerPage | Local path to the page used to separate print jobs. If this value is Null, a separator page is not used for this printer. |
Description | Description of the printer. This description is available to anyone accessing the printer over the network. |
Location | Physical location of the printer. |
Model | Model name of the printer (for example, HP LaserJet 6). |
Priority | Priority assigned to the printer (and to print jobs). |
StartTime | Earliest time that the printer can begin printing documents. |
UntilTime | Latest time that the printer can continue printing documents. |
Send us your feedback | « Previous | Next » |