5

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?

samyb8
  • 121

3 Answers3

3

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

harrymc
  • 498,455
0

The delay ("after some time (around 1h)") tells me that maybe your Power Options are set to an odd configuration. Check Control Panel > Power Options and see if there's anything there regarding shutdown after inactivity. Otherwise, see if your Group Policy settings are forcing logouts.

0

Here is how I do it:

Create a Disconnect.bat file on your desktop at work. Edit it with notepad like this:

rundll32.exe user32.dll,LockWorkStation 
tscon rdp-tcp#0 /dest:console

Then when you want to disconnect your RDP session from home, do not close the remote desktop window and do not disconnect, instead click on the disconnect.bat file on your desktop at work (seen remotely from home).

On your home computer there will be a message box displayed with a message that you have been disconnected, do not worry about that. You will get disconnected at home but your desktop at work will remain as if you walked away from it. It means that you remain logged in etc.

The advantage of this approach is that it works regardless on domain group policy settings - IT staff of bigger companies is seldom willing to modify or create a new policy just for one user.

Actually other answers exist even on this site with the same hint, check them to find a suitable version for you: https://superuser.com/a/355936/285900