Managing Printer Operations

Microsoft® Windows® 2000 Scripting Guide

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

PropertyDescription
CapabilitiesArray 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

CapabilityDescriptionsArray 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.
DescriptionDescription of the printer.
DeviceIDUnique identifier of the printer, used to distinguish it from other devices on the system.
DriverNameName of the printer driver.
LocationPhysical location of the printer.
NameLabel by which the printer is known.
PortNamePort 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.
SeparatorFileName of the file used to create a separator page.
ServerNameName of the server that controls the printer.
ShareNameShare name of the printer.
StartTimeEarliest 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).
TimeOfLastResetDate and time this printer was last reset.
UntilTimeLatest 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

PropertyDescription
CollateBoolean value indicating whether the pages that are printed should be collated.

This property is ignored if the printer driver does not support collation.

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

CopiesNumber of copies to be printed.
DeviceNameFriendly name of the printer.
DriverVersionVersion number of the printer driver. Version numbers are created and maintained by the driver manufacturer.
DuplexBoolean value indicating whether printing is done on both sides (True) or only one side of the medium (False).
HorizontalResolutionPrint resolution in dots per inch for the width of the print job. This value is set only when the PrintQuality property is positive.
NameName of the printer.
OrientationPrinting orientation of the paper. Values include the following:

1 Portrait

2 Landscape

PaperLengthLength of the paper (in tenths of a millimeter). To determine the size of the paper in inches, divide this value by 254.
PaperSizeSize of the paper.
PaperWidthWidth of the paper (in tenths of a millimeter). To determine the size of the paper in inches, divide this value by 254.
PrintQualityOne 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

ScaleFactor 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.
SpecificationVersionVersion number of the initialization data for the device associated with the printer.
TTOptionIndicates 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.

VerticalResolutionPrint 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

PropertyDescription
BannerPageLocal path to the page used to separate print jobs. If this value is Null, a separator page is not used for this printer.
DescriptionDescription of the printer. This description is available to anyone accessing the printer over the network.
LocationPhysical location of the printer.
ModelModel name of the printer (for example, HP LaserJet 6).
PriorityPriority assigned to the printer (and to print jobs).
StartTimeEarliest time that the printer can begin printing documents.
UntilTimeLatest time that the printer can continue printing documents.

send us your feedback Send us your feedback « Previous | Next »   


Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
Microsoft Windows 2000 Scripting Guide(c) Automating System Administration 2003
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 635

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net