Monitoring Print Jobs

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

In general, monitoring is limited to printers and print queues; as an administrator, your primary concerns are that printers remain available and that print queues are up and running. Sometimes, however, it is useful to monitor each print job sent to a printer. This kind of monitoring can catch conditions such as:

  • Documents that get stuck in a print queue that is, documents that for some reason do not get printed, even though other documents in the queue do get printed.
  • Large documents that monopolize printer time. Depending on the size, a single document can delay the printing of scores of other documents.
  • Workload that is inequitably distributed among printers. For example, Printer A might print 100 documents each hour, while Printers B and C, with the same capabilities and located in the same room, print only 5 or 10 documents an hour.

Print jobs can be monitored using the Win32_PrintJob class. Some of the Win32_PrintJob properties useful in monitoring print jobs are shown in Table 13.3.

Table 13.3   Win32_PrintJob Properties for Monitoring Print Jobs

PropertyDescription
CaptionShort description of the printer. Typically, the caption is the name of the printer followed by the print job ID. For example:

printer1, 171

DocumentName of the print job; equivalent to the file name of the document being printed. The user sees this name when viewing the set of documents in a print queue.
HostPrintQueueName of the computer on which the print job was created.
JobIdIdentifier assigned to the print job.
JobStatusString representing the job s status. Common status values include:

Printing

Error

Degraded Indicates that a print job is paused.

NotifyUser to be notified upon job completion or failure.
OwnerUser that submitted the job.
PagesPrintedNumber of pages that have been printed. This value might be 0 if the print job does not contain page-delimiting information.
PriorityUrgency or importance of execution of a job, with a range of 0 to 99. Higher-priority jobs are printed before lower-priority jobs.
SizeSize of the print job (in bytes).
StatusMaskBitmap of the possible status conditions relating to this print job. Values include the following:

1 Paused

2 Error

3 Deleting

4 Spooling

5 Printing

6 Offline

7 Paperout

8 Printed

9 Deleted

10 Blocked_DevQ

11 User_Intervention_Req

12 Restart

For more information about working with bitmap values, see "Script Runtime Primer" in this book.

TimeSubmittedTime that the job was submitted.
TotalPagesNumber of pages in the job. This value might be 0 if the print job does not contain page-delimiting information.
UntilTimeTime after which the job is invalid or should be stopped. For example, you can specify that if the document is not printed by 5:00 P.M., it should not be printed at all.

A comparison of Win32_PrintJob properties and the print job properties seen in the GUI is shown in Figure 13.1.

Figure 13.1   Win32_PrintJob Properties

Win32_PrintJob Properties

In addition to the Win32_PrintJob class, the IADsPrintJob interface can be used to monitor print jobs. Properties available through the IADsPrintJob interface are shown in Table 13.4. Many of these properties can be configured by using scripts; those that cannot be are denoted as read-only.

Table 13.4   IADsPrintJob Properties

PropertyDescription
DescriptionName of the document and the application used to print that document. For example, the description for the document Budget.xls printed using Excel would be "Budget Excel".
HostPrintQueue (read-only)ADsPath of the print queue (for example, WinNT:// atl-ps-01/ArtDepartmentPrinter).
NotifyLogon name of the user to be notified when the print job has finished printing.
PriorityPriority assigned to the print job, ranging from 1 99. Print jobs with higher priorities are printed before those with lower priorities.
Size (read-only)Size of the print job, in bytes.
StartTimeEarliest time when the print job can begin printing.
TimeSubmitted (read-only)Date and time that the print job was submitted.
TotalPages (read-only)Total number of pages in the print job.
UntilTimeLatest time that the print job can be printed.
User (read-only)Logon name of the user who submitted the print job.

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