This is an recurring issue when using horribly written print drivers. In this situation there was two suspects (which both are guilty); HP Universal Print Drivers and Konica Minolta Universal Driver.
For some reason both these drivers refuse to run in anything other than CSR mode (Client Side Rendering). On a terminal server this can get disasterous, as they populate the same keys over and over and over inside
HKEY_USERS\.DEFAULT\Printers, just with a different GUID each time. Combine that with users who have every printer on the planet mapped to their userprofile, and you get a shitstorm of printer installation every time they log off.
In this specific situation the terminal servers had millions of entries inside the registry hive.
The steps to "solve" this has been:
- Install MS hotfix 2778831 if you are running 2008 R2, and MS Hotfix 2871131 if you are running 2008 R2 SP1 or 2012 R2.
- Keep the list of drivers as minimal as possible. Remove the driver packages that you don't need
- Update the drivers (this stopped the HP driver from spamming the registry, Konica driver still sucks)
- Set drivers to shared isolation mode, and change the print processor to
winprint in hopes of stopping CSR from activating
- Clean out all the junk from
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider
- Stop Windows from deleting and re-creating printer connections every time a user logs off (or disconnects) by setting
RemovePrintersAtLogoff=dword:00000000 in the key
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider. Remember to restart the spooler.
- Clean print software from
HKEY_USERS\.DEFAULT\Software and printer connections from
- Boot a Windows PE image and compress the registry
- If using HP UPD in a managed environment - install the group policy templates from HP Managed Print Administration and disable all the extra "features", like the popups about toner remaining and super deals on new toners and such. It slows down the spooler, as it has to trigger a new process to start every time you so much as look at the printer inside Windows.
- Do not install full printer application packages on a terminal server. Just use normal drivers on a shared print server, without any kind of "easy" discovery methods or dynamic print targets.
I suspect that one just has to do the tasks above at intervals. Maybe it could be scripted.
Do you wonder, after reading all this, if you too have the same problem? Go to
%SystemRoot%\System32\config and check the size of the file
DEFAULT. If it's anything larger then a few hundred MB's then it's time to put on your detective hat.