Wilco van Bragt - LinkeIn Wilco van Bragt - Twitter rssa 

Managing Printer Drivers

Managing Printer Drivers

Still one of the greatest challenges in Terminal Server environments are the printer drivers. In this article I will describe how you can manage your pinter drivers in such a way you can beat the challenge.




Introduction

 

At the support forums you can easily see that still that one the biggest challenges in the Terminal Server infrastructure is printing. Many many questions are there why users can not print, blue screens on the servers and so on. In the article Can Third Party Software solve your Terminal Server Printing problems I already described in detail why the challenges are there, but summarized these are the main reason:

- Printer drivers are not written to be used on Terminal Servers;
- Printjobs use alot of bandwidth;
- Version conflicts by third party drivers;
- All printer drivers need tobe available on all Terminal Servers.

Therefore a couple of manufacturers developed a Universal Printer Driver solution. Microsoft Fallback driver, Citrix Universal Driver and equivalent solutions by the other SBC product suppliers can be used if you are using the auto created client printing method, but can not be used for network Printers. For Network printer there are also software solutions like Uniprint, Thinprint or Provision Print-IT.

But except the budgetary reason these universal network print solution can not always be used because the physical printer or application does not support the usage of a universal driver. In other words on almost every Terminal Server environment native drivers need to be available independent which solution have been chosen.

Native driver rules

Because the native drivers need to be used often it is good to use the rules below with implementing those native drivers.

No do use Kernel drivers

 

Within Windows 2003 Microsoft moved printer drivers from the kernel to the User mode. Of course this was a good move by Microsoft. If a printer driver is failing it is not causing a problem bleu screen anymore. Although there are not many kernel drivers more you should definitely check if the driver is a so called version 3 (usermode) drivers. Definitely do not install or support version 2 drivers anymore on your environment.  See the article Surviving Printing <<LINK>> by Stefan Vermeulen for more information about recognizing version 2 drivers.

Use only certified drivers

 

Although this is valid rule one big remark should be made about this certified story. Neither Microsoft nor Citrix are officially certifying printer for use on a Terminal Server. If a manufacturer is using this term it actually means that they tested there driver on a Terminal Server environment. This is giving you a little more security that the driver will function normally on your environment and should always be a rule to accept a new printer(driver). If the manufacturer is not mentioning that is has a certified or supported driver do not implement that one.

Out of personal experiences I would also suggest to use a driver supplied by the manufacturer in stead of the default driver included within the operating system. You get more support for your supplier and I noticed that the Windows drivers regularly do not support all the options of the printer.

 

Keep the amount of drivers low

Although you should add native drivers if necessary, try to limit the amount of drivers. This can be done by using the same driver for several printer types. Often the changes to the several printer types are marginal like the HP Laserjet 4xxx series. The different series works perfectly using a driver of a previous version. For example the HP Laserjet 4250 works fine using a HP Laserjet 4100 driver. A second possibility is to check the real manufacturer of the printer. Lots of the printers are using the same internal part, but only the outside is little bit different. For example Ricoh is manufacturing for several printer suppliers. Often those printers can be using the same driver, because the base driver in the package is delivered by Ricoh. HP has now also a universal printer available, which supports almost all their printers. It is good way to limit the amount of drivers, but keep in mind that people are experiences that some options are not supported yet. Nevertheless this looks like a promising solution if you are using lots of HP printers.

Create a supported list of printers

If your IT Department does not have the control of purchasing the printers, you should definitely create a list of supported printers. On this list you only mention printers that you can guarantee that they work perfectly within your environment. Of course you should keep the list up to date with new models, which you have tested and passed judgement. In this way you also keep the amount of drivers low.

 

No allow RDP auto created printer (if using Citrix Presentation Server)

 

This rule is one of the most important rules. The RDP Client by default enabled auto created client printer. Often administrators use this client to connect to the Terminal Servers for system management purposes. Because of the administrator rights the drivers which are locally available will be installed to support the auto created client printing functionally within the RDP protocol. Disable the support of this feature using a GPO policy.

Prevent adding printer drivers by normal users

Also prevent users by adding printer drivers. When using Citrix Presentation Server configure Citrix policies to use the universal printer driver if the native driver is unavailable (with auto created client printer) or take care the drivers as on the print server, client and Terminal Servers are exactly the same.

Manage the drivers

Now you have followed all the rules it is time to manage the drivers. As you probably all know it one of the basic concepts to keep your server 100% identical. In this way users are always experiencing the same behavior when using with their applications. For printer drivers exactly the same concept is valid. If the drivers and driver settings are exactly the same on all your servers, the print experiences of the user are always identical. Citrix has replicate function availability within the Citrix Management Console, but out of practice experiences this is not the most reliable component. But with a easy script you can arrange this your self. All drivers (information) are stored in the one folder and two registry keys, so with an easy delete and copy commands you can replicate the drivers and settings. What is needed is a driver package, which stores all the drivers for your environment.

To accomplish this use a empty Terminal Server (only with the operating system possibly with Citrix Presentation Server) to install all the needed drivers on it.

After installation create the driver package by copying all file out of the folder %SYSTEMROOT%\system32\spool and export the registry keys  [HKLM]\System\CurrentControlSet\Control\Print\Environments and [HKLM]\System\CurrentControlSet\Control\Print\Monitors. The last step is to check if driver created a INF file into %systemroot%\INF. If so a copy is needed of these file and the corresponding PNF files. This set together your driver package; store this on a file share. In the supplement you will a script to replicate the drivers on your server with this driver package, with a short explanation. Start this script every time the server is restarted (tip: use the Windows Scheduler with the startup function).

If an additional driver is necessary use a clean server again, implement the driver package and install your additional driver and repeat the steps above mentioned.

Conclusion

In this article we first came to the conclusion that native drivers are needed often on your server. Secondly we created a list of rules for printer drivers to make an easy implementation and maintenance possible. The last step is to ensure that all the drivers are 100% identical on all the servers using a simple script and driver package.

Supplement

Store the folder %SYSTEMROOT%\system32\spool on file://filserver/SHARE/printerdriver/spool
Store the .INF and .PNF files on file://filserver/SHARE/printerdriver/spool
Store the registry export of [HKLM]\System\CurrentControlSet\Control\Print\Environments as printerdrivers.reg on file://filserver/SHARE/printerdriver/REG
Store the registry export of [HKLM]\System\CurrentControlSet\Control\Print\Monitors as monitors.reg on file://filserver/SHARE/printerdriver/REG

Implement the following script at start-up of your Terminal Server.

 

::----------------------------------------------------------------------------------------------
:: Script:                    :   PrinterDrivers.CMD
:: Created by:            :   Wilco van Bragt (http://sbc.vanbragt.net/)
::
:: ----------------------------------------------------------------------------------------------

:: Disable Logons

CHANGE LOGON /DISABLE

:: SET PATH

SET DRIVERPATH=\\<<FILSERVER>>\SHARE\Printerdriver\spool

SET INFPATH\\<<FILSERVER>>\SHARE\Printerdriver\inf

SET REGPATH\\<<FILSERVER>>\SHARE\Printerdriver\reg

SET SOURCE\\<<FILSERVER>>\SHARE\Printerdriver\

:: Wait 30 second to get the printer spooler services started (or put the services on manual).

%SOURCE%\SLEEP.EXE 30

:: Stop Print Spooler and corresponding services

NET STOP "Citrix Print Manager Service" /yes

NET STOP "Print Spooler" /yes

:: Remove the printer registry keys

%SOURCE%\REG.EXE DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers" /FORCE

::Remove all printer drivers from the spool directory

DEL /s /Q /F %SYSTEMROOT%\system32\spool

:: Import driverpackage registry keys

%SYSTEMROOT%\REGEDIT.EXE /S "%REGPATH%\PrinterDrivers.REG"

%SYSTEMROOT%\REGEDIT.EXE /S "%REGPATH%\monitors.REG"                                                                                        

:: Replicate the printerdrivers 

%SOURCE%\ROBOCOPY.EXE "%DRIVERPATH%" "%systemroot%\system32\spool" /MIR /R:1 /W:1 /NP                                

XCOPY "%INFPATH%" "%systemroot%\INF" /E /C /I /Q /H /R /Y

:: Start the print services (again)

NET START "Print Spooler"                                                                                                   

NET START "Citrix Print Manager Service"

:: Enable Logons

CHANGE LOGON /ENABLE

:: End of script

GOTO :EOF

Article previous published at MSTerminalServices.org.