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:
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
Property | Description |
---|---|
Caption | Short description of the printer. Typically, the caption is the name of the printer followed by the print job ID. For example:
|
Document | Name 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. |
HostPrintQueue | Name of the computer on which the print job was created. |
JobId | Identifier assigned to the print job. |
JobStatus | String representing the job s status. Common status values include: Printing Error Degraded Indicates that a print job is paused. |
Notify | User to be notified upon job completion or failure. |
Owner | User that submitted the job. |
PagesPrinted | Number of pages that have been printed. This value might be 0 if the print job does not contain page-delimiting information. |
Priority | Urgency or importance of execution of a job, with a range of 0 to 99. Higher-priority jobs are printed before lower-priority jobs. |
Size | Size of the print job (in bytes). |
StatusMask | Bitmap 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. |
TimeSubmitted | Time that the job was submitted. |
TotalPages | Number of pages in the job. This value might be 0 if the print job does not contain page-delimiting information. |
UntilTime | Time 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
Property | Description |
---|---|
Description | Name 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). |
Notify | Logon name of the user to be notified when the print job has finished printing. |
Priority | Priority 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. |
StartTime | Earliest 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. |
UntilTime | Latest 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 | « Previous | Next » |