5 comments

Remote Desktop Session Disconnection Issue

Published on Tuesday, December 21, 2010 in , ,

In the project I’m currently involved in, we have several virtual machines installed with Windows 7 as the operating system. These workstations are used as administration workstations to manage the server infrastructure. Every once and a while someone would get disconnected from their terminal server session. By simply reopening the session they could continue their work. We stumbled upon the following KB article: KB2083411 The article states:

When the policy is refreshed (by default, every 90 minutes, or manually through GPUPDATE), the policy settings are deleted and then reset. During this period, the configuration on the server is temporarily valid. Therefore, all sessions may be disconnected

Because we were enabling remote desktop through GPO, this was the exact issue we were having.  We could reproduce it by executing gpupdate in a remote desktop session. The disconnection would not occur every time, but every once in a while. To be more precise when enabling remote desktop through group policies (Allow users to connect remotely using Terminal Services ), the following registry key is set:

image

The workaround suggested in the KB article is to set the registry key fDenyTSConnections below HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server to a value of 0. Basically this is just enabling remote desktop through the registry instead of through the GUI.

If you have to do this on a lot of workstations there are a few options. We first thought to just deploy this using our desktop deployment solution (SCCM). However a colleague of mine had the great idea to just try setting it using group policy preferences. Whenever group policies are being refreshed, everything below HKLM\SOFTWARE\Policies is erased and reset, but group policy preferences operate in an other way. Whenever you set something with group policy preferences, it’s set forever, unless you check the option “remove this item when it is no longer applied”. For some additional information on the differences between GP policy setting and GP preference settings.

Here are also some related topics on the TechNet forums: http://social.technet.microsoft.com/Forums/en/winserverGP/thread/10fb967c-c6c8-480b-8d30-70f0da15cdba and http://social.technet.microsoft.com/Forums/en/winserverGP/thread/cd94ea99-a843-4781-bbcf-7538182511c9

Related Posts

5 Response to Remote Desktop Session Disconnection Issue

Anonymous
14 November, 2012 22:46

Thanks so much! I set up a GPO like you suggested and that solved the problem! No more broken RDP connections when I do a gpupdate /force.

05 March, 2013 13:08

Nice suggestion.Very helpful one.Keep posting your experiences.Remote Infrastructure Management

Mattias G
22 October, 2013 12:20

Thank you! This solved it for us in Windows 7 as well. Was getting random disconnects for a few months when using RDP and just now decided to solve it once and for all. Set the reg value using preferences and no more problems.

05 December, 2013 21:03

I also want to thank you for posting this. This issue was driving my team crazy! It's very poor planning on the part of Microsoft. Thankfully there are folks like you around to help clean up the mess and (hopefully) influence future revisions of how group policy processing handles active Remote Desktop sessions.

13 July, 2017 12:39

Nice post.

Add Your Comment