SOLVED

Bug: no reconnect to disconnected session with fSingleSessionPerUser=0

Copper Contributor

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.

 

15 Replies
I wonder why there is no feedback for a proper bug report. Is this forum actually the right place to report bugs ?

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

The same problem still exist. 

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

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/ff...)

 

 

@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...

 

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

@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.

 

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-clie...

@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

best response confirmed by Vinz Focker (Copper Contributor)
Solution

@Vinz Focker 

 

Here is the solution:

 

https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-ever...

 

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

@Vinz Focker 

 

Here is the solution:

https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-ever...

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

Thanks for sharing this Vinz! Will test it nearest time and report back if it will help

@sergiiV2285  I have tried that solution but didn't work. Did you tired at your end.

@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

 

Don't thank me. It is @MosheSI who deserves all the glory ;)
1 best response

Accepted Solutions
best response confirmed by Vinz Focker (Copper Contributor)
Solution

@Vinz Focker 

 

Here is the solution:

 

https://medium.com/@moshecombr/windows-2019-rdp-rdsh-not-able-reconnect-to-disconnected-session-ever...

 

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

View solution in original post