Stop log off when disconnected from RDP session

By default, a standalone Windows installation will not logoff disconnected RDP sessions.

So your installation must have been customized for it to be logging off disconnected RDP sessions.

Start MMC.

Load the Group Policy Object Editor snapin. It will be targeting the Local Computer.

Drill down to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Session Time Limits

Verify that the setting "Set time limit for disconnected sessions" is either Not Configured, or Enabled, but with a setting of Never.


To add what @Ryan wrote, if the Local Security Policy is "Not Configured", next you must check the Terminal Services Configuration / Remote Desktop Configuration. Right-click the "Connection", choose "Properties", and check that there are no "Force Disconnect" option being enforced.

(I don't have access to a Windows Server 2008 R2 machine at the moment; I'll update/fix my answer when I regain access)

Erratum: The location is Start > Administrative Tools > Remote Desktop Services > Remote Desktop Session Host Configuration. Double-click on "RDP-Tcp", and go to the "Sessions" tab.

Edit to add: Do note, though, that without limiting sessions with forced logoffs, you will sooner or later run into the hard-coded 2 RDP sessions limitations (including 'console' sessions), necessitating a Forced Logoff after all.


The GPO answers work as well, i just wanted to add to the answers. This is as Ryan says, out of the ordinary, since by default your sessions can idle for as long as they want. You can however customize the disconnect time with the policy mentioned. The registry key involved with this policy, should you need to configure this on a single server is

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services

Create or update a DWORD called MaxDisconnectionTime Now set the amount of time a user can be disconnected in miliseconds. EG : 1209600000 for 14 days and so on.

If you want the disconnect to be unlimited you can delete the value.