HOW TO CONNECT A NETWORK PRINTER TO THE ZENTYAL SERVER AND GET WINDOWS XP DOMAIN USERS TO AUTOMATICALLY MAP THE NETWORK PRINTER UPON LOGON
The problem: It is easy to connect Zentyal to a network printer using CUPS, and it's easy to share the printer so that Windows XP workstations can see it. It is also easy to automatically map the workstation to the printer when a user logs on. The problem is with the drivers.
When a Windows XP computer tries to map a network printer connected to Zentyal, you get an error message saying that the server has incorrect drivers installed, and then you have to select a driver from a large list. You have to do this on every workstation! But there is a workaround. We can upload the correct Windows driver from a workstation to the server so that every subsequent workstation that maps to the network printer will use the correct driver automatically, and you won't have to manually choose it each time.
1. Connect the network printer to Zentyal: Use the web interface and go to Print Sharing. Tell it to listen to the interface that your internal network is connected to so it will forward print requests from workstations to the printer. From there you can open the CUPS user interface. Go through the steps to add a printer. It doesn't really matter which printer driver you use because we will change it later by uploading new drivers from a workstation, but try to find the right one anyway. Give the printer a name and make sure you check the box to share the printer.
2. Upload the correct Windows driver to the server via a workstation connected to the domain: a) Log on to the domain from a Windows XP workstation using the network administrator username. b) Open Windows Explorer and navigate to My Network Places>Entire Network>Microsoft Windows Network>Your Domain. c) Right-click on the new printer share icon and select the Properties entry. This may open a dialog box that indicates that "The printer driver is not installed on this computer. Some printer properties will not be accessible unless you install the printer driver. Do you want to install the driver now?" It is important if this pops up at this point to answer “No”. d) Go to the Advanced tab and click the New Driver button that is next to the Driver box. This launches the "Add Printer Wizard". e) Select the correct printer driver and click Finish to start the driver upload. f) When it is finished uploading, you need to change one setting (i.e. The paper size or something) and apply the changes. This is a weird thing that is necessary so that the printer settings are initialized in the Samba printers database. Click Apply to commit your settings. Revert any settings you changed just to initialize the Samba printers database entry for this printer.
3. Automatically map the workstations to the network printer upon logon: On the Zentyal server, navigate to /home/samba/netlogon and edit your logon.bat file. Add the following two lines to your logon file, the first one adds the printer, and the second line sets it as default:
rundll32 printui.dll,PrintUIEntry /in /n \\NameOfServer\NameOfPrinter
rundll32 printui.dll,PrintUIEntry /y /n\\NameOfServer\NameOfPrinter
4. Test It: Now log on to a domain workstation as a regular user. The logon bat should run, and you will see a windows briefly appear indicating that it is connecting to the network printer; this time you won't get an error message saying that the wrong driver is installed. Go to Start>Printers & Faxes, your network printer should be listed there and set as default.