Printing in Remote Desktop 2012 R2

The problem(s): Oh, the problems. Out of the last 3 RDS deployments on Windows Server 2012 R2 I’ve been involved with, precisely all of them have had problems with network printers. Some of the issues you might face;

  • Printing from Adobe Reader will occasionally give users the following error
  • The horrorDuplicate printers which you cannot remove
  • You can set the default printer, but it will not display the default printer ‘tick’ icon
  • The default printer setting may not be retained, or the printers may not map correctly for all users on logon

The solution: The amazingly in-depth post from this human may help you;

Fix numerous print issues with RDS 2012 by cleaning up your print environment

In the cases I dealt with, unfortunately these steps did not do the trick. Some of the steps fixed a couple of the issues; putting in the script to clear all default printers at logoff fixed the issue with the default printer tick not appearing, and stopped the Adobe Reader issue from occurring for most users. If you get a user who doesn’t log out for a while, however, and you do not have Group Policy configured to log off idle sessions, they will likely run into the issue again.

In the end, I decided to install local printers on each of the Remote Desktop servers, and use the Security settings to make sure each user only sees the printers they require.

There were also a couple of other steps needed to completely get rid of the duplicate printers. My process is below;

  1. On your print server, edit the properties for all of your printers and ensure that the following option is NOT tickedYou really don't need this
  2. Log all users out of the RDS server, apart from yourself of course
  3. Stop the Print Spooler service (command: net stop spooler)
  4. Open regedit and go here
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers
  5. It will probably look a lot like thisCurse this evil key
  6. Back up the ‘Client Side Rendering Print Provider’ key and then rename it, adding ‘_old’ to the end
  7. Create a new key in its place called ‘Client Side Rendering Print Provider’ – this will be left empty
  8. Open Devices and Printers, and remove any duplicate printers that appear under your administrator account (Right-click > Remove Device)
  9. Start the Print Spooler service back up (command: net start spooler)
  10. The new ‘Client Side Rendering Print Provider’ should begin to repopulate. Once you have confirmed printing is working OK, delete the old ‘Client Side Rendering Print Provider’ key

Those pesky duplicate printers should now be gone, and should stay gone so long as you don’t have ‘Client Side Rendering’ enabled on your print server.

Note: The advice in this article is given as is with no guarantees of any kind. Be careful when delving into the registry and make sure you have backups of anything you change.

13 thoughts on “Printing in Remote Desktop 2012 R2

  1. Thank you for posting this info. This worked with a customer who had the same issue. We did see it come back though, but with weeks of working good in between. Suspects one specific printer triggers it. Another customer gets 2008R2 servers for remote desktop, to avoid the hell this problem caused! Hope Microsoft fixes it!

  2. I’m going to try this, if this fixes this problem I want to know if you are a woman, because I’d kiss you right away to thank you 🙂

  3. Thanks for the post. We have found ourselves in this exact situation. Microsoft support has been no help and we need to find a new solution. How did you restrict which printers are seen by each user on the RD session hosts? Did you remove the INTERACTIVE account from the Security tab and just add user/groups with the Print permission?

    1. Yes exactly that, remove Everyone / Authenticated Users / INTERACTIVE or whichever is the most all-encompassing security principal, then add security groups to grant the ‘Print’ permission to specific users. If they do not have any permissions they will not see the local printer.

      You can speed this up with Powershell if you have a lot of servers – once you have configured the Security tab for a specific printer, this command will give you a string containing the permissions:

      (Get-Printer “PrinterName” -full).PermissionSDDL

      You can just copy and paste the string into a Set-Printer command if you like (replace ‘perms’ below with the output) and use it on your other servers.

      Set-Printer “PrinterName” -PermissionSDDL “perms”

      You could also use the Set-Printer command on other printers on the same server, if they need to have the same security setup.

  4. After following the directions in the digital zombies page, most things were fixed, but I still had occasional duplicate printers and default printer selection problems. I found that a lot of rubbish accumulates in the registry which needs a periodic cleanup. This is what you need to remove:

    HKLM\SYSTEM\CurrentControlSet\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc} <- All numbered keys
    HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses\{0ecef634-6ef0-472a-8085-5ad023ecbccd} <- All ##?#SWD#PRINTENUM# keys
    HKLM\SYSTEM\CurrentControlSet\Control\DeviceContainers\ <- All keys containing SWD\PRINTENUM values under GUID\BaseContainers\GUID
    HKLM\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM\ <- All subkeys
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\ <- Everything

    I created the following powershell script to clean this up. I schedule the RDS servers to run the script once a week then restart. I schedule it like this as some valid values will get deleted, but they are recreated on startup.

    Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceClasses\{0ecef634-6ef0-472a-8085-5ad023ecbccd}\##?#SWD#PRINTENUM#*"| Remove-Item -Recurse -Force
    Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}\*" -exclude "Properties" | Remove-Item -Recurse -Force
    Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM\*"| Remove-Item -Recurse -Force
    get-childitem "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceContainers\" -ErrorAction SilentlyContinue -Recurse -exclude "{00000000-0000-0000-FFFF-FFFFFFFFFFFF}"|where-object {$_.property -like "SWD\PRINTENUM*"}| foreach-object {(get-item $_.PSParentPath).PSParentPath}|Remove-Item -recurse -Force
    Get-childItem "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\*" | Remove-Item -Recurse -Force

    1. Very interesting post !
      Thank ScottK fot this wonderful Powershell script.
      Exactly what I needed

      the script work perfectly, exept for “HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM” which are protected key …

      >I schedule the RDS servers to run the script once a week then restart
      Sorry for the question but … how do you get your script working for those specific keys ?

  5. We are experiencing the same problem. The Digital Zombie link is not working any longer. Does anyone have a valid link by chance?

  6. Does any have a full copy or export of the original digital zombies post? It seems the website is no-longer active and I would really like a read of it.

    Thanks
    CJ

  7. the PS Script fixed my issues 😀 Thank you

    What i did:

    This seems to wipe out ghost printers/duplicate printers/tattooed GPO’s/ Adobe Document cannot be printed.

    After running clean_printers.Ps1 they server must be rebooted otherwise GPO printers wont apply.

    Will need to get this into one script.. but just ran this quickly:

    1. Downloaded Pstools and saved to c:\pstools
    2 Created StartPS_as_System.ps1

    Start-Process -FilePath cmd.exe -Verb Runas -ArgumentList ‘/k C:\pstools\PsExec.exe -i -s powershell.exe’

    3 Created Clean_Printers.ps1

    Get-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Control\DeviceClasses\{0ecef634-6ef0-472a-8085-5ad023ecbccd}\##?#SWD#PRINTENUM#*”| Remove-Item -Recurse -Force
    Get-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Control\Class\{1ed2bbf9-11f0-4084-b21f-ad83a8e6dcdc}\*” -exclude “Properties” | Remove-Item -Recurse -Force
    Get-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM\*”| Remove-Item -Recurse -Force
    get-childitem “HKLM:\SYSTEM\CurrentControlSet\Control\DeviceContainers\” -ErrorAction SilentlyContinue -Recurse -exclude “{00000000-0000-0000-FFFF-FFFFFFFFFFFF}”|where-object {$_.property -like “SWD\PRINTENUM*”}| foreach-object {(get-item $_.PSParentPath).PSParentPath}|Remove-Item -recurse -Force
    Get-childItem “HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\*” | Remove-Item -Recurse -Force

    4. Run StartPS_as_System.ps1 with powershell Then run Clean_printers.ps1 & reboot the server.

Leave a Reply

Your email address will not be published. Required fields are marked *