Network Printing |
Windows 2000 provides several utilities to help you administer your network printing resources.
Some enterprise configurations require clients to connect to network printers during an unattended setup. Microsoft facilitates this with the rundll32 command, which allows printers to be installed from the command line. This is particularly useful when you need to add or remove printers from a group of users by means of a logon script.
The rundll32 command provides greater control than older supplemental utilities such as Con2prt.exe, which allowed only for the addition and deletion of networked printers. For example, the rundll32 command allows local printers to be modified and deleted. It also allows you to add printer connections by computer rather than by user as the Add Printer Wizard does. The result is that you can control all aspects of the end user's printing experience by running a local or remote batch file or logon script containing rundll32 commands.
The case-sensitive syntax for the rundll32 command is:
rundll32 printui.dll,PrintUIEntry <options>
Examples of useful options include:
rundll32 printui.dll,PrintUIEntry /il /c\\computer
This installs a printer for the user logged on a remote computer named computer by running the Add Printer Wizard. You can also type:
rundll32 printui.dll,PrintUIEntry /ga /c\\computer /n\\print_server\printer
This adds a connection to print_server/printer for all users on a remote computer named computer.
The available options for rundll32 are shown in Figure 4.17
Figure 4.17 Rundll32 Options
The PrnAdmin utility lets you use scripts that perform administrative printer functions. You can create your own scripts or modify one of the sample scripts that is provided with PrnAdmin. Either way you can manage both local and remote printers using PrnAdmin.
This tool can perform the following functions:
Note
To create scripts, you need to know a scripting language such as Microsoft® Visual Basic or JavaScript or be able to make use of the objects provided by PrnAdmin in any language that supports COM programming.
To install PrnAdmin, type the following command:
regsvr32 [Path]PrnAdmin.dll
To use the PrnAdmin sample scripts shown in Figure 4.18, type:
Cscript prnmgr.vbs
Figure 4.18 PrnAdmin Scripts