As we have seen demonstrated in almost every aspect of the product, Windows NT is able to work in a diverse networking environment. This flexibility extends to network printing as well. In an effort to support Internet standards, including TCP/IP-based services, as well as provide smooth integration with UNIX platforms, Microsoft included a set of TCP/IP printing utilities with Windows NT.
These utilities enable NT to print to TCP/IP network printers as well as receive and process incoming TCP/IP print jobs. These functions are provided using the Line Printer Remote (LPR) protocol, for sending print jobs and the Line Printer Daemon (LPD) for receiving them. NT also implements a third common protocol, the Line Printer Query (LPQ), which enables you to query the status of a TCP/IP print device.
The TCP/IP Printing service in Windows NT are based on the Berkeley-style remote printing protocols called the Line Printer Daemon (LPD) and Line Printer Remote (LPR). These protocols are defined are the most prevalent protocols in use today for TCP/IP-based printing and are defined in Request for Comment (RFC) 1179.
Many versions of UNIX based on System V do not support the Berkeley-style remote printing features and will not be compatible with the TCP/IP Printing service in Windows NT.
The LPD featurethe capability to receive and process a print jobunder Windows NT is implemented as an NT service, which quietly listens for incoming print jobs and submits them to the appropriate NT-based printer. There is no front-end interface that can be manipulated, with the exception of starting and stopping the TCP/IP Printing service.
The LPR supportthe ability to send a job to a remote machine for processingis handled in Windows NT by the LPR print monitor, which is accessed from the standard printer interfaceseither the Print Manager, or the Printer Wizard. You can also submit an LPR print job directly from the command-line interface using the LPR.EXE utility.
If you want to get status information from a remote LPD print queue, you can use the third utility, LPQ, which is only available in the form of the LPQ.EXE command-line utility.
This chapter explores how to install the TCP/IP Print Services, as well as how to configure NT Server as a TCP/IP printing client, and as a TCP/IP print server. It also discusses using the LPR.EXE and LPQ.EXE command-line utilities and their proper syntax.
Under Windows NT 3.5 and 3.51, the TCP/IP Printing service was the source of a tremendous number of calls from Microsofts Product Support Services (PSS). This is because some of the documentation on the TCP/IP Printing service was incomplete and occasionally inaccurate, leading to a lot of customer confusion. If you are going to use TCP/IP printing, I recommend you review this chapter thoroughly.
Installing the TCP/IP Print Services
The TCP/IP print services are not installed by default with Windows NT. Additionally, before you can install the TCP/IP print services, you must first install TCP/IP. Please refer to Chapter 11, Installing and Configuring Microsoft TCP/IP, for more information.
A very common misunderstanding stems from misconceptions about printing with LPR/LPD over TCP/IP, and printing using NetBIOS over TCP/IP. If you have a Windows environment running TCP/IP, you probably do not need to install the Microsoft TCP/IP Printing service. You only need to install the Microsoft TCP/IP Printing service if you need to send a print job to a UNIX workstation or a stand-alone network printer that uses the LPR/LPD protocols (RFC 1179), or if you need to enable your NT Server to accept print jobs from UNIX clients, or other network clients that send RPF 1179-compatible print jobs.
Once you have TCP/IP installed and configured, use the following procedure for installing the TCP/IP print services:
You must be logged on as a member of the local Administrators group in order to install the Microsoft TCP/IP Printing service.
Open the Control Panel and double-click the Network icon.
Select the Services tab and you should see a list of all the network services currently installed on you system, similar to those listed in Figure 13.1.
The Microsoft TCP/IP Printing service is installed using the Network Control Panel applet.
You might be asked for the location of the Windows NT distribution media. Enter the correct path or insert the CD-ROM into the appropriate drive. Click OK. NT will now copy necessary files from the distribution media. When it is completed, you are returned to the Network Control Panel window.
Click the Close button. NT will analyze and update the network bindings. When it is finished, you will be asked if you want to reboot your system.
Click Yes to restart the system.
To be quite honest, unless you installed the TCP/IP protocol at the same time as the TCP/IP Printing service, you shouldnt need to restart NT after installing the TCP/IP Printing service. Ive tried not restarting on many configured systems configured in different ways and Ive always been able to get the TCP/IP Printing service to work without restarting first.
If you want to print to remote TCP/IP print devices, your installation is complete. However, if you want to use NT Server as a TCP/IP print server, you must also start the TCP/IP Print Server service. For more information on this, please see the section called Setting Up NT to Accept TCP/IP Print Jobs later in this chapter.
Setting Up NT to Print To a Remote TCP/IP Printer or Print Queue
Windows NT can print to any device capable of accepting Berkeley-style LPR jobs, as described in RFC 1179. In order to print to a TCP/IP print server, you must first create a printer (print queue) on the NT Server and tell it where to send its print jobs. When creating a printer, Windows NT treats a TCP/IP print server exactly like it would a printer connected directly to the server through the LPT or similar port. Except, instead of passing the print job directly to the LPT port, NT passes the job across the network using LPR.
Once you have set up an NT printer and told it the address of the remote TCP/IP print server, you can share the NT printer, exactly as you would any other NT printer. This enables any computer capable of sending print jobs to your NT Serverincluding Windows 3.1, Windows 95 and Macintosh clientsto print to the TCP/IP print server using the NT Server as an intermediaryeven if the client does not have TCP/IP installed.
One of the additional benefits you gain from using the NT Server as an intermediary device is security. There is no user authentication model included in RFC 1179, which defines TCP/IP printing with LPR, so if you configured all your clients to print directly to the printer using LPR, you would be unable to manage any real security for the printer. By creating an NT printer and making clients access the printer by means of the NT Server, you gain all the functionality of NT printing, including print job auditing and user-level printing permissions. In addition, you could ensure that clients cant bypass the NT Server by configuring the LPD server to only accept print jobs from the NT Servers IP address. Many stand-alone network printers support this kind of IP-level filtering.
To create an NT printer that sends its jobs to a TCP/IP print server, follow these directions:
You must be logged on as a user with enough privileges to create a printer, such as a member of the Administrators, Power Users, or Print Operators local groups.
From the Start Menu, choose Settings, then Printers. This opens the Printers window, as shown in Figure 13.3.
Use the Add Printer Wizard to create a new printer, or to connect to an existing printer on the network.
Select the option for My Computer and click the Next button to continue.
It might seem strange to choose the My Computer option, because you are in fact connecting to a printer on the network. The option for Network Print Server only works if you are connecting to a printer on the network shared by a Windows for Workgroups 3.1x, LAN Manager, Windows 95, or Windows NT system (any SMB-based print device), or by a Novell server if you have Gateway Services for NetWare installed. When you print to a remote TCP/IP printer, you actually need to create an NT printer on your local computer, which is responsible for forwarding the job to the network printer. For stand-alone network printers that you print to using AppleTalk, DLC, or TCP/IP LPR/LPD, you must create the printer on your system. This is why you choose the My Computer option.
You now need to specify the port you want to print to. By default, you should see a some LPT and COM ports listed. Click on the Add Port button to specify the location of the TCP/IP printer. This will bring up the Printer Ports window.
Choose LPR Port from the list of available print monitors, as shown in Figure 13.5. Click OK.
If the LPR Port option does not appear in the list of available print monitors, then you have not installed the Microsoft TCP/IP Printing service. See the section Installing the TCP/IP Print Services earlier in this chapter for more information on installing TCP/IP printing support.
The Add LPR Compatible Printer window will appear, as shown in Figure 13.6.
Enter the printers address and print queue name into the Add LPR Compatible Printer window.
In the first field, enter the host name or IP address of the computer that is providing the TCP/IP print server (LPD) service. If the host is a computer, such as a UNIX system, you would enter the DNS name or IP address of the UNIX system. If you have a printer connected directly to the network that accepts LPR print jobs, you would enter its IP address, or its DNS name, if one has been assigned.
In the second field, enter the name of the printer as defined on the host system. If the print server is a UNIX system running LPD, you would enter the printer as it is named on that system. If the host is a printer connected directly to the network, consult the manufacturers directions for the appropriate name to use.
If you're getting overloaded with the word printer, youre not alone. In the previous paragraph, you are asked to enter the printer on the LPD print server. RFP 1179 provides for multiple virtual or physical printers that are serviced through a single LPD print device. If you cant find your printers instructions, you can try leaving this field blank.
Click the OK button to continue. NT will send an LPD test command to the print server you just specified. If it fails, NT will warn you that it could not establish communications with the LPD server, as shown in Figure 13.7. If you are sure that the information is correctmaybe the printer is turned offthen click OK to continue.
NT will give you an error message if it cannot find the LPD server you specified.
Click Close to close the Printer Ports window and return to the list of available ports in the Add Printer Wizard. The port identifier for the LPD server you just specified should appear in the list of available ports, as shown in Figure 13.8.
You must specify the make and model of the printer.
It is important that you choose the correct make and model for the printer so that NT knows exactly what features the printer includes and how to work with it. Choosing the wrong printer can often cause unpredictable results.
Give the printer a name, as shown in Figure 13.10. You also need to tell NT whether or not you want to make this your default printer. Since this is a server, if you already have other printers created, you probably want to select No.
Give the printer a name and specify if you want it to be the default printer when printing jobs from the server console.
Click the Next button to continue. This will take you to the screen where you specify that you want the printer to be shared to the network.
Click the Shared button, as shown in Figure 13.11. Specify the name you want the printer shared as. If you have MS-DOS or Windows 3.x clients, you should make the share name 8 characters or shorter. If you will have Windows 95 or NT clients that need to print to the printer, you should specify the appropriate printer drivers to be installed.
The Printer Properties page is used to change various settings once the printer has been created.
You should take the opportunity to enter any comments about the printer, as well as the location. If you want to change scheduling, sharing, security, or device settings you can do it now, or later as necessary. For more information on these options, refer to Chapter 8, Configuring and Installing Print Services.
Click OK when you are finished configuring the printer.
The printer you just created and shared on the network is capable of receiving print jobs from any Windows NT client. This means that standard Windows clients, other NT clients, Macintosh clients, and Novell clients (with File and Print Services for Netware) can all print to this printer through the NT Server. The strength in this feature is that the clients dont need to have TCP/IP-based printing tools installed. For more information on printing strategies, please see Chapter 9.
Setting Up NT To Accept TCP/IP Print Jobs
Setting up NT to act as a TCP/IP print server is actually very simple. Use the following procedure to enable NT Server to accept incoming TCP/IP print jobs from UNIX or other systems using Berkley-style LPR print utilities:
Install the Microsoft TCP/IP Printing service as described earlier in this chapter.
Make sure you are logged on as a user with administrative rights. Open the Control Panel and double-click on the Services icon.
Find and click on the TCP/IP Print Server entry from the list installed of services. The TCP/IP Print Server entry is shown in Figure 13.13.
Set the TCP/IP Printer Server to automatically start.
If you want to use the TCP/IP Print Server service before the next time you restart Windows NT, you should click the Start button to start the TCP/IP Print Server service now.
Close the Services window and the Control Panel.
You can now use your system as a TCP/IP print server to accept Berkeley-style LPR print jobs for any printer created on your NT system.
There is no mechanism to enable you to configure the TCP/IP Print Server service on a per-printer basis. The service runs with the built-in SYSTEM account and cannot be configured to run under a different user context. Because the Spooler service also runs with the built-in SYSTEM account, there is no mechanism that can be used to deny access the TCP/IP Print Server service access without also interrupting other necessary system functions.
This means that if you install the TCP/IP Print Server service, by default, anyone can print to any printer connected to the system without any reliable level of auditing and access restrictions.
Additionally, the TCP/IP Print Server will accept jobs for any printer created on your server, even if the printer has not been shared!
Using the LPR Utility To Print To a Remote TCP/IP Printer
If you want to send a simple text file to a remote TCP/IP printer that is running an LPD service, you can use the LPR command-line utility.
The syntax for the LPQ command is
lpr -S server -P printer [-C Class] [-J Jobname] filename
-S server is the DNS name, or the IP address of the host.
-P printer is the name of the printer or queue on the host.
-C class specifies the content of the banner page for the class.
-J jobname specifies a name for the job. This name will show up if someone views the print queue status on the print server.
filename is the name of the file you want to print.
For example, if I wanted to print a file c:\test.txt to a printer called HPLaserJet on a UNIX system called unixServer.xyzcorp.com, I would use the following command:
Using the LPQ Utility To Check the Status of a TCP/IP Print Queue
The LPQ utility enables you to query the queue status of an LPD print server.
The syntax for the LPQ command is
lpq -S server -P printer [-l]
-S server is the DNS name, or the IP address of the host.
-P printer is the name of the printer or queue on the host.
-l requests a detailed status. Most LPD servers will ignore this switch.
For example, if I wanted to know the status of a printer called HPLaserJet on a UNIX system called unixServer.xyzcorp.com, I would use the command:
lpq -S unixServer.xyzcorp.com -P HPLaserJet
This chapter explored how to use Windows NT to interoperate with UNIX systems, as well as stand-alone print servers running LPR and LPD services. It discussed how to install the TCP/IP Print Services for Windows NT and covered some of the limitations of using LPR and LPD for remote network printing. You also saw how to configure NT Server as a TCP/IP printing client, in addition to configuring it as a TCP/IP print server. Finally, we covered how to use the LPR.EXE and LPQ.EXE command-line utilities, including why and when to use them.