Forum Discussion

Vinz Focker's avatar
Vinz Focker
Copper Contributor
Jul 24, 2018
Solved

Bug: no reconnect to disconnected session with fSingleSessionPerUser=0

Affected: All Server 2019 Insider Previews including build 17713

 

Steps to reproduce: (no need to install RDSH role to reproduce the bug)

  • enable multiple sessions per user:
    Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections -> "Restrict Remote Desktop Services users to a single Remote Desktop Services Session" to "Disabled"
  • rdp to the server and log in as Administrator
  • close the mstsc window or disconnect
  • rdp to the server again, log in as Administrator and you will get a new session
    taskmgr now shows 2 Administrator sessions: one disconnected and the new one just created
  • close the mstsc window or disconnect
  • rdp to the server again, log in as Administrator and you will get a new session
    taskmgr now shows 3 Administrator sessions: two disconnected and the new one just created
  • ...

If fSingleSessionPerUser == 0 you will not be able to reconnect to any disconnected session.

 

However, now the interesting part:
If you lock the session before the disconnect (ctrl+alt+end -> lock, then close mstsc) you will be successfully reconnected.

I suspect the error is in  termsrv.dll's CSessionArbitrationHelper::Sessions_EnumDisconnectedUserSessions function.

 

You can alsoe reproduce this without rdp, directly on the console.
Set the policy as mentioned above, log in as Administrator, disconnect your own session in task manager, log in again and you get a new session.

 

This bug seems to be in termsrv.dll since Windows 10 1803 already.

 

  • Vinz Focker 

     

    Here is the solution:

     

    https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-every-time-new-session-a1891df6e9c8

     

    gpmc.msc — Edit users policies— User Configuration — Policies — Administrative Templates — All Settings — Remove Lock Computer — Change to Enabled

15 Replies

  • MosheSI's avatar
    MosheSI
    Copper Contributor

    Vinz Focker 

     

    Here is the solution:

     

    https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-every-time-new-session-a1891df6e9c8

     

    gpmc.msc — Edit users policies— User Configuration — Policies — Administrative Templates — All Settings — Remove Lock Computer — Change to Enabled

    • Vinz Focker's avatar
      Vinz Focker
      Copper Contributor

      MosheSI  Awesome! Thanks a lot!
      Another way is setting the DisableLockWorkstation Registry Value to 1:

      Windows Registry Editor Version 5.00
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
      "DisableLockWorkstation"=dword:00000001
      

       

  • hari4a3's avatar
    hari4a3
    Copper Contributor

    I do facing the same issues where when i try to connect to newly deployed server 2019 each time its establishing a new session instead of connecting back to new session and the session count is keep increasing. Have tried to applied the solution as per below but didn't work through. Is it really a bug with server 2019 or something i need to look for?

    https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/troubleshoot/rdp-client-disconnects-cannot-reconnect-same-session

    • sergiiV2285's avatar
      sergiiV2285
      Copper Contributor

      hari4a3 

      no Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options - different options not working for us

       

      keepalive - also not helpful.

      even with "Disconnected" session - you will never get this session back with current bug

  • Andreas_Sammer's avatar
    Andreas_Sammer
    Copper Contributor

    Vinz Focker

    We have the same Problem with a Production Windows 2019 Server (Build 17763)

    Locking the Session before disconnecting does seem to help, but is not a usable workaround for us.

     

  • ScottMoore's avatar
    ScottMoore
    Copper Contributor

    2016 server task manager's user list has right-click "Reconnect".  Seems like the community agrees this issue is a result of the RemoteFX configuration being enabled by default

     

    https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ff817578(v=ws.10)

     

     

    • sergiiV2285's avatar
      sergiiV2285
      Copper Contributor

      ScottMoore 

       

      You mentioned some story (link was broken, i found it via search)..

      https://social.technet.microsoft.com/Forums/windowsserver/en-US/68dfb072-9192-4f5e-a9e3-d75298d9f971/rd-is-terminated-before-even-starting-access-is-denied?forum=winserverTS

       

      but as i can see it is not related to our issue..RD is terminated - is not the same that we have.

       

      We always get a new session, no matter what happened (resize, short internet outage, etc).

      Just not possible to connect to previously running session, when this feature is enabled.

       

      Regards,

      Sergii Vinnikov

    • sergiiV2285's avatar
      sergiiV2285
      Copper Contributor

      Do we have any solutions for this? 

      We have same problem even for current build of 2019 server that is used in Production

       

      So problem migrated further..

      Please help

  • Vinz Focker's avatar
    Vinz Focker
    Copper Contributor

    The bug still happens with Windows Server 2019 Insider Preview Build 17723

    • MosheSI's avatar
      MosheSI
      Copper Contributor

      Vinz Focker 

       

      Here is the solution:

      https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-every-time-new-session-a1891df6e9c8

      gpmc.msc — Edit users policies— User Configuration — Policies — Administrative Templates — All Settings — Remove Lock Computer — Change to Enabled

      • sergiiV2285's avatar
        sergiiV2285
        Copper Contributor
        Thanks for sharing this Vinz! Will test it nearest time and report back if it will help
  • Vinz Focker's avatar
    Vinz Focker
    Copper Contributor
    I wonder why there is no feedback for a proper bug report. Is this forum actually the right place to report bugs ?

Resources