Configuring Printer Availability

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

Print management commonly includes the scheduling of printer availability. For example, many organizations limit the hours during which print jobs can be printed. This is often done to prevent users from printing personal documents after the close of regular business hours. It also provides an opportunity for support personnel to perform routine maintenance without the fear of interrupting a submitted print job.

Alternatively, printer scheduling might be used to allow users to submit print jobs during business hours and have those print jobs automatically printed late at night, when the printing will not interfere with other documents.

For example, suppose a user routinely prints a 300-page document for use the next day. You can create a logical printer for that user and schedule the printer to print only between the hours of 2:00 A.M. and 6:00 A.M. The user sends the print job to this custom printer each time the document is printed. The job queues but does not begin printing until 2:00 A.M. Therefore, it does not monopolize the printer during regular working hours.

Printer availability can be configured by modifying the IADsPrintQueue properties StartTime and UntilTime.

Scripting Steps

Listing 13.17 contains a script that configures the availability of a printer. To carry out this task, the script must perform the following steps:

  1. Use a GetObject call to bind to the printer ArtDepartmentPrinter on the print server atl-ps-01.
  2. Set the value of the StartTime property to 6:00 A.M. To ensure that the correct data type is used when setting StartTime, use the VBScript TimeValue function.
  3. Set the value of the UntilTime property to 1:00 A.M. To ensure that the correct data type is used when setting StartTime, use the VBScript TimeValue function.
  4. Use the SetInfo method to apply the changes to the logical printer.

Listing 13.17   Configuring Printer Availability

1 2 3 4 
Set objPrinter = GetObject("WinNT://atl-ps-01/ArtDepartmentPrinter") objPrinter.StartTime = TimeValue("6:00 AM") objPrinter.UntilTime = TimeValue("1:00 AM") objPrinter.SetInfo  

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