RDS - W2019 - Default Printer lost on session disconnect or logout/login

Mirto Morinini 96 Reputation points
2020-12-11T08:06:33.16+00:00

Greetings,

we have a major Issue we need to fix ASAP.
RDS Farm with 1 VM for Print Server, 1 VM RD Gateway, 1 VM RD Broker, 4 VM RDS Host (single collection).

Customer decided to let the users connect the printers they need, no deploy via GPO or PS Scripts.

Issue: Default Printer always changed back to a PDF Printer (not redirected, installed on RDSh). Already tried to disable Easy Print and Windows decide the Default Printer, plus do not set default client printer to be default printer in a session. Redirected Printer are not the source of issue, the same problem applies even if I connect directly to RDS Host without such option activated, and for a brand new user, after Profile is created and connect a printer from print server, setting it as default, the issue is the same.

I noticed it takes a lot of time to printers connected from print Server to appear, the Default Printer always fall back to a PDF Printer even on Session Disconnect / Reconnect!

I'm also aware we have a lot of entries on
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Connections

I'm not sure if cleaning everything up would help to fix the issue.
Any help would be greatly appreciated!

Best Regards,

Mirto Morinini

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,248 questions
Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
641 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mirto Morinini 96 Reputation points
    2020-12-16T19:30:22.96+00:00

    I achieved some interesting results:

    I performed the steps mentioned above:

    • Open registry with psexec -i –s c:\windows\regedit.exe
    • Delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider" and then Re-Create it (empty)
    • Add under Client Side Rendering Print Provider "RemovePrintersAtLogoff" / 00000000
    • Export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM\PrintQueues , delete PRINTENUM Key it, then re-create it, then Import again all the Exported Items of PrintQueues
    • Do the same step for HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Enum\SWD\PRINTENUM and HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SWD\PRINTENU
    • Restart the Server

    After this, I finally got rid of all the odd registry entries that were coming back and ghost printers. I logged via RDweb with a User, connected a printer from print server, set it as default. Logged out, Logged in --> Standard Printer OK

    I did the same by re-logging to RDweb, Logging in, and the Standard Printer was still ok!

    I believed that finally this hell was over, but there is still the major issue: if the User make a proper Logoff/Login, everything is fine.
    But if the User just disconnect the session, and then reconnect, the standard printer is lost again. I really have no clues what RDS Protocol is doing and I've really no clues why on session disconnect/reconnect he's running again a "scan" of all printers, that it takes a few minutes before they appear on Printer and devices in control panel or in System Configuration GUI.

    It's already a good improvement, and I think if nothing else can be found, i'll just force a logout by disconnecting to make sure the Standard Printer will be kept.

    But I'd really like to find a fix for this. It doesn't make any sense that a user cannot disconnect/reconnect to a session and loosing the Standard printer this way.

    Any further help will be greatly appreciated, thanks!

    Edit 30.12.2020: One day after I posted this, actually I wasn't able to reproduce the issue anymore. Restarting all RDSH and the Broker, and setting a daily task to stop the spooler, delete print queues, start the spooler at night, solved actually the issue. Standard Printer don't get lost anymore with disconnect/reconnect. I've done the same operation on the RDS Prod collection and achieved the same positive result.


8 additional answers

Sort by: Most helpful
  1. Ciemala, Markus 1 Reputation point
    2020-12-30T07:12:22.227+00:00

    Hi @Mirto Morinini

    i'm suffering the same problem with our RDS 2019 farm (1x VM Broker; 1x VM Gateway; 1x VM UserProfile Disk Server; 5x VM Session Host; 2x VM Print Server)

    The problem is exactly the same as you mentioned, but somehow I can't recreate it on every user.
    I've already installed a new print server, because the old one was running Server 2012 R2 - but no fix.

    Would be great if MS has some information here!

    But I've noticed some strange behavior too, this didn't really fix the problem but was helpful anyway.
    We have about 50 printers in our network, due to the add printer option Windows starts some kind of printer discovery and adds discovered printers automatically with an WSD Port to the whole Session Host.
    The problem with this was, users started printing on other printers instead of their own because the default printer was silently changed to an automatically installed WSD Port printer.
    This causes some major problems, especially for our HR Team and other Teams which print privacy documents.

    The fix for this problem was to deactivate every WSD communication on every network printer.
    Adding Printers is still easy possible for every user, but no more automatically installed WSD Port printers.

    0 comments No comments

  2. Ciemala, Markus 1 Reputation point
    2021-01-04T16:00:04.003+00:00

    Hi @Mirto Morinini

    At first also a happy new year!

    Thanks for the feedback.
    I'll clean up the registry this week - hope this will fix the problem permanently.

    I've taken a closer look to the Client Side Rendering Print Provider Reg Key - the DWORD "RemovePrintersAtLogoff" 0 is already there.
    Maybe I've taken your approach a few weeks/months ago but not completely.

    In terms of the printer connection I agree with you - luckily our users don't really print that often so the redirected printers from home office connections is not that much.

    Also thanks for the WSD Port hint - I've disabled the WSD features on all printers, and it seems to be fixed.
    The WSD Ports on either the Print Server or RDSH are also deleted completely and printers are only connected via TCP/IP.

    0 comments No comments

  3. Mirto Morinini 96 Reputation points
    2021-01-05T11:30:26.803+00:00

    Thanks @Ciemala, Markus , happy new year to you as well!
    I'm very glad I could be of any help with the struggles with printers :)

    Don't forget to re-add this registry value after you delete / recreate the key. And make sure you are using psexec -i –s c:\windows\regedit.exe or you won't be able to clear all entries.

    I've discovered the problem of Standard Printers with the current scenario is caused from few clients, that they suffer of the exactly same issue - even if you manually delete from control panel / windows 10 menu the printers, they still hide in the registry, and all of sudden, a deleted printers appear again and set itself as default!

    We finally started to configure things properly, editing the RDweb RDP Icon and disabling to connect printers, letting the users connect the printers and set default on RDSH Servers, in the way redirected printers are not an Issue anymore. And, for all people working Home-Office, they can simply use the other RDP Icon where printers get connected.

    Best regards

    0 comments No comments

  4. Mirto Morinini 96 Reputation points
    2020-12-30T17:06:12.64+00:00

    Hi @Ciemala, Markus

    Microsoft got in touch with me, but the solution proposed is actually exactly the same I've already suggested.
    But, there is no need as I added to create PS Scripts for Logon/Logoff and open Printers as Security groups.

    After I cleaned up the registry in the way I described above:

    • Open registry with psexec -i –s c:\windows\regedit.exe
    • Delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider" and then Re-Create it (empty)
    • Add under Client Side Rendering Print Provider "RemovePrintersAtLogoff" / 00000000
    • Export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM\PrintQueues , delete PRINTENUM Key it, then re-create it, then Import again all the Exported Items of PrintQueues
    • Do the same step for HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Enum\SWD\PRINTENUM and HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SWD\PRINTENU
    • Restart the Server

    The Problem resolved on the RDS Prod Collection as well.

    I think the root of the Problem you have could be related, and certainly do such operation won't damage for sure. Doing it will NOT cause any issue in terms that the User will need to re-connect the Printers, after the clean up all Printers that were previously connected to the server (so not the redirected printers, the one connected manually on RDSH from the Print Server) were still there.

    I never had good experiences by using WSD Ports. Check if the printers are not appearing wild / register themselves to print server or appearing on Users Session / Clients, on the Printers Web Interface you should have the possibility to disable this feature.

    Remove all WSD Ports you have on your Print Server, if you have already opened TCP IP Standards Ports, DELETE the Ports then Re-create them (trust me, I had odd experiences by "recycling" TCP IP Ports instead of deleting and re-creating them), and assign them to the proper printers.

    For now the problem is solved for this customer, still, i'm not very happy with the whole. But this was a mistake in the design, because all Users got on their Desktop (very few Thin Clients, mostly Notebooks) the RDP Icon from RDweb. Since on the collection it was set "Connect Printers" and "Set Standard Printer the remote computer standard printer", they are actually working only with redirected Printers. A lot cleaner solution would have been to have a manual RDP Icon for all Users WITHOUT connecting printers, and let the Users connect/set standard printers on RDSH, and instruct the Users Out of Office to Login via RDweb, where the Standard Printer will be properly set the current Standard Printer (so basically their printer at home, since most people are working home office during covid times).

    At the same time, I've been evaluating 3th party RDS Printing Software. ThinPrint is a monster, it has so many amazing features, definitely next-generation printing. But this should be sold as product with all the features and perks it brings, because just to fix issues, it's DEFINITELY too expensive (29 usd per user).
    Another Software I've found EXCELLENT with his Concept, but I still need to check how it will behave with Thin Clients, is TSPrint. Price is very affordable in this case (500 USD per RDSH), check out the video on their site to see the concept.

    I wish you best of luck in fixing your issue, and happy new year!

    0 comments No comments