Remote desktop sessions - Unwanted automatic log off after period of time

The first thing to check would be the timeout settings in Terminal Services Configuration. It's in the Sessions tab in the TSC.


There are group policy settings under Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Sessions regarding how long you can stay connected.

Some details at http://www.windowsnetworking.com/articles_tutorials/Terminal-Services-Group-Policy.html

Bear in mind, these settings are at the computer level, not the user level so this will apply to anyone connecting to the servers you apply it to.

If you would rather keep others with the current behavior (and even yourself unless specifically needing to run longer operations) you can leave it as is but when you have the need to run something long term, connect to the console session of the server.

Depending on your version of the RDP client it is either /console or /admin when connecting, run mstsc /? to see which one for you.

For example: mstsc /v:192.168.1.1 /admin

That will connect you to the console session of the machine at 192.168.1.1.

The console session is the session that you would see when physically at the machine with keyboard, video and mouse. If you are disconnected from this session, your operations will continue to run and you can reconnect to it.


Open gpedit.msc

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

Enable the "Set time limit for disconnected sessions" and set it to Never

and change the Local Security Policy under Local Policies->Security Options-> Interactive logon: Do not require CTRL+ALT+Del" to Enabled, the problem dissapears.