Windows – Session logged out after disconnection of remote connection

logoutremote desktoptimeoutwindows 10windows 7

I remote from my home PC (Windows 10) to my work computer (Windows 7) and every time I disconnect my remote connection (or just close it), after some time (around 1 hr) the work Windows session logs out and next time I remote or when I get to work the next day, I find my session logged out. All my open software closes, of course.

We tried the following solution:

https://serverfault.com/questions/269438/how-to-stop-remote-desktop-from-closing-my-session-due-to-inactivity

But nothing has been solved. It seems to be a timeout issue after remote disconnection, but I cannot find the config for this.

Any known solution for this?

Best Answer

On the Windows 7 server :

  1. Start gpedit.msc
  2. Browse to :
    Computer Configuration --> Administrative Templates --> Windows Components --> Remote Desktop Services --> Remote Desktop Session Host --> Session Time Limits.
  3. Enable "Set time limit for disconnected sessions" and set it to Never.
  4. Use regedit to go to the key
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services
    and ensure that MaxDisconnectionTime is set for the amount of time you want to set as the time limit in milliseconds (12 hours = 43200000). If it does not exist, create it as New DWORD (32-bit). (more info.)
  5. Reboot.
  6. Verify after reboot that the above registry setting has not changed. (In a domain, the domain settings may override local ones.)

If this doesn't work and your server is in a domain, have the IT people check in your OU the setting of "Terminate disconnected session".

Related Question