Bagikan melalui


Network Printing Tools and Settings

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Network Printing Tools and Settings

In this section

  • Network Printing Tools

  • Network Printing Registry Entries

  • Network Printing Group Policy Settings

  • Network Printing WMI Classes

  • Network Ports Used by Network Printing

  • Related Information

Network Printing Tools

The following tools are associated with Network Printing.

Prndrvr.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

You can use the Prndrvr.vbs script to administer printer drivers, for example, use this script to add, delete, and list drivers, either locally or remotely.

Prndrvr.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

Prnjobs.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

The Prnjobs.vbs script controls print jobs. With this script, you can pause, resume, cancel, and list print jobs, either locally or remotely.

Prnjobs.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

Prncnfg.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

You can use the Prncnfg.vbs script to get and set printer configuration or to rename a printer, either locally or remotely.

Prncnfg.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

Prnqctl.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

The Prnqctl.vbs script is used to print a test page, pause or resume a printer, and clear a printer queue, either locally or remotely.

Prnqctl.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

Prnmngr.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

With the Prnmngr.vbs script, you can add and delete printers, and list printers and printer connections. You can also use it for getting and setting the default printer.

Prnmngr.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

Prnport.vbs

Category

Operating system tool.

Version compatibility

Runs on Windows Server 2003. Cannot run on or target computers running earlier versions of Windows.

Use the Prnport.vbs script to add, delete, and list Standard TCP/IP ports. You can also use it for getting and setting the port configuration.

Prnport.vbs is written in VBScript and uses the Windows Management Instrumentation (WMI) print provider to administer the printing sub-system.

PrintUI.dll

Category

Operating system tool.

Version compatibility

Runs on Windows 2000, Windows XP, and Windows Server 2003.

PrintUI.dll allows you to modify or delete local printers. It also allows you to add printer connections for users based on their computer names rather than by having users add their own printers. As a result, you can control most of the end user’s printing experience by running a local or remote batch file or a logon script that contains PrintUI.dll commands.

You are encouraged to use the VBScripts listed in the WMI Print Provider or the PrnAdmin sections instead of using this utility.

PrnAdmin

Category

Resource Kit tool.

Version compatibility

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 are provided with PrnAdmin. Either way, you can manage both local and remote printers by using PrnAdmin.

PrnAdmin is written in VBScript, and its file name is Prnmgr.vbs.

PrnAdmin performs these functions:

  • Adds or deletes the following:

    • Local or remote printers.

    • Printer connections.

    • Local or remote forms.

    • Ports on local or remote servers.

    • Printer drivers on local or remote servers.

  • Enumerates ports, drivers, printers, or forms on local or remote printers.

  • Pauses, resumes, or clears the print jobs of a local or remote printer.

  • Configures a local or remote printer.

To find more information about PrnAdmin, see “Resource Kit Tools Help” in the Tools and Settings Collection.

Network Printing Registry Entries

The Windows platforms that use these registry entries and subkeys are noted in the Version portion of the listings. Many registry elements that are noted as being for Windows XP and Windows Server 2003 might also work on older versions of Windows; check documentation specifically for those versions for more details.

The information here is provided as a reference for use in troubleshooting or verifying that the required settings are applied. It is recommended that you do not directly edit the registry unless there is no other alternative. Modifications to the registry are not validated by the registry editor or by Windows before they are applied, and as a result, incorrect values can be stored. This can result in unrecoverable errors in the system. When possible, use Group Policy or other Windows tools, such as Microsoft Management Console (MMC), to accomplish tasks rather than editing the registry directly. If you must edit the registry, use extreme caution.

The following registry entries and subkeys are associated with Network Printing.

For more information about registry entries, see the “Registry Reference” in the Tools and Settings Collection.

CurrentControlSet\Control\Print

The following registry entries are located under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print.

BrowsePrintWorkstations

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Used to calculate the number of clients in whose browse list the printer appears.

EnableBroadcastSpoolerStatus

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Specifies whether the system sends spooler and job status messages when the job count changes.

MaxRpcSize

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Specifies the maximum size, in bytes, of incoming data blocks from a remote procedure call (RPC).

Monitors

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

The Monitors subkey stores entries for print monitors installed on Windows Server 2003. The Monitors subkey contains a subkey for each port monitor that stores configuration data for the port monitor installed on the system.

NetPrinterDecayPeriod

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Specifies how long a network printer remains in the browse list.

PendingUpgrades

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

The PendingUpgrades subkey is used by Windows Server 2003 during setup.

Providers

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

The Providers subkey contains information about the network printers. The printers listed in this subkey are not hosted locally, but they are printers to which the local computer is connected.

ServerThreadTimeout

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Specifies the amount of time that the server thread is idle before it notifies other print servers of its printers.

SpoolerPriority

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print

Version

Windows XP and Windows Server 2003.

Specifies the priority class of the print spooler process. The priority of the print spooler process establishes a range of priority for print spooler threads.

environment-name

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments

Version

Windows XP and Windows Server 2003.

The environment-name subkey represents a computing platform environment and stores entries that apply only to that environment.

Version-number

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\environment-name\Drivers

Version

Windows XP and Windows Server 2003.

The Version-number subkey contains information about the drivers for a print environment. There is a different number for each version of the printer driver. Version-2 drivers are for Windows NT 4.0; Version-3 drivers are for Windows 2000 and Windows Server 2003.

driver-name

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\environment-name\Drivers\Version-number

Version

Windows XP and Windows Server 2003.

The driver-name subkey contains information about necessary files and settings for the specified printer driver.

Version

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\environment-name\Drivers\Version-number\driver-name

Version

Windows XP and Windows Server 2003.

Stores the version number of the installed printer driver specified by driver-name in the registry path.

monitor

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors

Version

Windows XP and Windows Server 2003.

The monitor subkey contains information about the status and drivers of the monitors used by the computer, and the actual name of the subkey corresponds to a unique monitor.

Ports

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\monitor

Version

Windows XP and Windows Server 2003.

The Ports subkey contains information about the current availability of the ports.

StatusUpdateEnabled

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\monitor\Ports

Version

Windows XP and Windows Server 2003.

Specifies whether the port monitor is able to update the spooler with the port status.

StatusUpdateInterval

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\monitor\Ports

Version

Windows XP and Windows Server 2003.

Specifies how often the port monitor updates the spooler with port status.

EventLog

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers

Version

Windows XP and Windows Server 2003.

Specifies the level of detail of events that the print spooler logs for local print jobs.

NetWare or Compatible Network

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers

Version

Windows XP and Windows Server 2003.

Stores options for printing when using print resources on NetWare servers.

RestartJobOnPoolEnabled

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers

Version

Windows XP and Windows Server 2003.

Specifies whether a print job to a local printer can be restarted after an error.

RestartJobOnPoolError

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers

Version

Windows XP and Windows Server 2003.

Specifies how long the print monitor waits after an error occurs before starting a print job on another port in the print pool.

DisplayName

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\NetWare or Compatible Network

Version

Windows XP and Windows Server 2003.

Specifies the localized name of the print service provider displayed in the Print Manager and Printers main window.

Name

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\NetWare or Compatible Network

Version

Windows XP and Windows Server 2003.

Specifies the dynamic-link library (DLL) for the NetWare or Compatible Print Service provider. This DLL is stored in systemroot\Winnt\System32.

Timeout

Registry path

HKLM\SYSTEM\CurrentControlSet\Control\Print\Providers\NetWare or Compatible Network

Version

Windows XP and Windows Server 2003.

Specifies how often Windows Server 2003 updates the print queue of a NetWare server. The value of this entry specifies the time interval between automatic refresh updates.

Microsoft\Windows NT\CurrentVersion\Print

The following registry entries are located under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print.

Printers

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print

Version

Windows XP and Windows Server 2003.

The Printers subkey contains information about the local printers.

Providers

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print

Version

Windows XP and Windows Server 2003.

The Providers subkey contains information about the network printers. The printers listed in this subkey are not hosted locally, but the local computer is connected to them.

printer-name

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers

Version

Windows XP and Windows Server 2003.

The printer-name subkey stores information about printers connected to the print server.

DefaultSpoolDirectory

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers

Version

Windows XP and Windows Server 2003.

Specifies the folder holding spooled files that the system is printing on a local printer.

PrinterDriverData

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\printer-name

Version

Windows XP and Windows Server 2003.

The PrinterDriverData subkey contains configuration data for the specified printer.

SpoolDirectory

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\printer-name

Version

Windows XP and Windows Server 2003.

Stores a printer-specific location for spool files. The value of this entry takes precedence over the global default stored in the DefaultSpoolDirectory entry.

Transparency

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\printer-name\PrinterDriverData

Version

Windows XP and Windows Server 2003.

Specifies the background mode when the value of the registry entry Winprint_TextNoCRTranslation is set to 1. If the background mode is set to transparent, then the driver will not print the background of the document, regardless of color.

Winprint_TextNoCRTranslation

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\printer-name\PrinterDriverData

Version

Windows XP and Windows Server 2003.

Enables or disables carriage return translation. By default, Windows Server 2003 translates a carriage return to a carriage return plus a line feed.

Winprint_TextNoTranslation

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\printer-name\PrinterDriverData

Version

Windows XP and Windows Server 2003.

Enables or disables carriage return and line feed translation. By default, Windows Server 2003 translates a carriage return or a line feed to a carriage return plus a line feed.

server-name

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers

Version

Windows XP and Windows Server 2003.

The server-name subkey stores information about printers connected to the print server specified by server-name.

Printers

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\server-name

Version

Windows XP and Windows Server 2003.

The Printers subkey contains information about the individual network printers to which the local computer is connected.

Providers

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\server-name

Version

Windows XP and Windows Server 2003.

The Providers subkey stores configuration data used by the specified server.

EventLog

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\server-name\Providers

Version

Windows XP and Windows Server 2003.

Specifies the level of detail of events that the print spooler logs for the specified server.

RestartJobOnPoolEnabled

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\server-name\Providers

Version

Windows XP and Windows Server 2003.

Specifies whether a print job on the print server, specified in the registry path by server-name, can be restarted after an error.

RestartJobOnPoolError

Registry path

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\LanMan Print Services\Servers\server-name\Providers

Version

Windows XP and Windows Server 2003.

Specifies how long the print monitor for the printer server, specified in the registry path by server-name, waits after an error occurs before starting a print job on another port in the print pool.

Network Printing Group Policy Settings

The following table lists and describes the Group Policy settings that are associated with Network Printing.

Group Policy Settings Associated with Network Printing

Group Policy Setting Description

Allow printers to be published

Determines whether the computer’s shared printers can be published in Active Directory.

Disallow installation of printers that use kernel-mode drivers

Determines whether printers using kernel-mode drivers can be installed on the local computer. If enabled, prevents a printer that is using kernel-mode drivers from being installed on the local computer.

Automatically publish new printers in Active Directory

Determines whether the Add Printer Wizard automatically publishes the computer’s shared printers in Active Directory.

Allow pruning of published printers

Determines whether the domain controller can prune (delete from Active Directory) the printers published by this computer.

Printer browsing

Announces the presence of shared printers to print browse master servers when Active Directory is not available.

Prune printers that are not automatically republished

Determines whether the system prunes printers that are not automatically republished. (Applies to printers running on operating systems other than Windows 2000 or Windows Server 2003. Also applies to printers running on Windows 2000 or Windows Server 2003 that are published outside of their domain.)

Directory pruning interval

Specifies how often the pruning service on a domain controller contacts computers to verify that their printers are operational.

Directory pruning retry

Specifies how many times the pruning service on a domain controller repeats its attempt to contact a computer before pruning the computer’s printers.

Directory pruning priority

Sets the priority of the pruning thread.

Check published state

Directs the system to periodically verify that printers published by this computer still appear in Active Directory. Also specifies how often the system repeats verification.

Web-based printing

Determines whether Internet printing is supported on this server. (If you disable this policy, Internet printing is not supported.)

Custom support URL in the Printers and Faxes folder

Adds a customized Web page link to the Printers and Faxes folder. By default, the Printers and Faxes folder includes a link to the Microsoft Support Web page or to the Web page for the vendor of the currently selected printer. You can use this policy to replace the default link with a link to your organization’s Web page.

Computer location

Specifies the default location criteria used when searching for printers.

Pre-populate printer search location text

Enables the physical Location Tracking support feature of Windows Server 2003 printers. If you disable this policy or do not configure it, Location Tracking is disabled. Printer proximity is estimated based on IP address and subnet mask.

Allow print spooler to accept client connections

Determines how clients access the print server over the network. By default, this policy setting automatically enables connections upon creation of the first shared printer or clustered server spooler resource.

Point and Print restrictions

Restricts a client computer’s ability to connect to and install a printer driver from print servers. By default, this policy setting allows managed clients to use Point and Print only with servers within their forest. An administrator can use this setting to add servers to the list of trusted print servers. Disabling this setting enables connections to any accessible print server.

For more information about Group Policy settings, see the “Group Policy Settings Reference” in the Tools and Settings Collection.

Network Printing WMI Classes

The following table lists and describes the WMI classes that are associated with Network Printing.

WMI Classes Associated with Network Printing

Class Name Namespace Version Compatibility

Win32_Printer

\root\cimv2

Windows XP and Windows Server 2003 ; supported as read-only in Windows 2000

Win32_PrinterConfiguration

\root\cimv2

Windows XP and Windows Server 2003

Win32_PrinterController

\root\cimv2

Windows XP and Windows Server 2003

Win32_PrinterDriver

\root\cimv2

Windows XP and Windows Server 2003

Win32_PrinterDriverDll

\root\cimv2

Windows XP and Windows Server 2003

Win32_PrinterSetting

\root\cimv2

Windows XP and Windows Server 2003

Win32_PrintJob

\root\cimv2

Windows XP and Windows Server 2003 ; supported as read-only in Windows 2000

Win32_TCPIPPrinterPort

\root\cimv2

Windows XP and Windows Server 2003

For more information that describes many WMI classes, see the WMI SDK documentation on MSDN.

Network Ports Used by Network Printing

The following table lists services used in network printing and the protocols they provide in the network printing process. Not all services are installed or active at all times, and the protocols used in network printing depend on the type of clients submitting jobs to the print server.

Port Assignments for Network Printing

Service Name UDP TCP

Services for Macintosh (uses AppleTalk)

201, 202, 204, 206

201, 202, 204, 206

Internet Printing Protocol (uses HTTP)

80

80

NWLink (uses IPX/SPX)

213

213

LPDSVC (accepts LPR)

515

515

LPR Port (sends LPR)

721-731, >1023

721-731, >1023

Server (using SMB)

137, 138

139

Server (using RPC)

530

530

Standard Port Monitor (using SNMP)

161, 162

161, 162

Standard Port Monitor (using LPR)

> 1023

> 1023

Standard Port Monitor (using RAW)

2000, 2501-2503, 3001, 6869, >=9100

2000, 2501, 2503, 3001, 6869, >=9100

Standard LPR, according to RFC 1179 from the Internet Engineering Task Force, uses ports 721 through 731 to send data. However, Windows Server 2003 can be configured on a per-port or per-server basis to use port number higher than 1023 for sending data with LPR.

Also different from RFC 1179 is the standard port monitor, which sends documents to a printer by using either the RAW or LPR printing protocol. Together, these protocols support most current TCP/IP printers.

The RAW protocol is the default print protocol for most print devices. To send a job formatted with RAW, the print server opens a TCP stream to the printer's port 9100 or another port number and selects the connections to multiport external devices. For example, on certain print devices port 9101 goes to the first parallel port, 9102 goes to the second parallel port, and so on.

The standard port monitor uses the LPR protocol when you specify LPR protocol during port installation or reconfiguration, or when the RAW protocol cannot be established.

The standard port monitor deviates from the LPR standard in the following ways:

  • The standard port monitor does not conform to the RFC 1179 requirement that the source TCP port must lie between port 721 and port 731. The standard port monitor uses ports from the general, unreserved pool of ports (1024 and above).

  • The standard port monitor sends a print job to the spooler without determining the actual job size and designates a default job size, regardless of the actual size of the job. The LPR standard states that print jobs must include information about the size of the job the port monitor sends. Sending a print job that contains job size information requires that the port monitor spool the job twice — once to determine size, and once to send the job to the spooler. Spooling the job once, by using the standard port monitor, improves printing performance.

The following resources contain additional information that is relevant to this section.