Configuring Printer Properties

Microsoft® Windows® 2000 Scripting Guide

microsoft windows 2000 scripting guide

« Previous | Next »   

Most of the IADsPrintQueue properties can be configured by using ADSI. These configurable properties provide a way for you to dynamically change your printing infrastructure as needed. For example, you can assign a higher priority to a particular printer, thereby ensuring that documents sent to that printer are printed first. Alternatively, you might want to share a printer over the network or use a script to modify the location or the availability of a printer.

Scripting Steps

Listing 13.16 contains a script that configures the priority 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 Priority to 2.
  3. Use the SetInfo method to apply the new priority to the logical printer.

Listing 13.16   Configuring Printer Priority

1 2 3 
Set objPrinter = GetObject("WinNT://atl-ps-01/ArtDepartmentPrinter") objPrinter.Priority = 2 objPrinter.SetInfo

Note that changing the priority of a printer is meaningless unless multiple logical printers are targeted to the same physical printer. For example, you might have a single physical printer that has two logical printers configured as follows:

  • Printer A, with a priority of 2
  • Printer B, with a priority of 1

In this case, any documents sent to Printer A print before documents sent to Printer B. Why? Because Printer A has a higher priority. If the physical printer has only one logical printer, documents will print in the order in which they are submitted, regardless of the priority assigned to the printer. This is because all print jobs will have the same priority.


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