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

I'm having an issue whenever I connect to any of our servers via RDP - After a certain period of time, it seems to close these sessions, closing all the applications i had open etc...

This is particularly annoying if I am running a long process - for example, copying a file - it cuts it off... I then re-connect via RDP, and it effectively loads a new session.

Is this set somewhere in Group Policy? Or somewhere else?

This is happening on Windows 2008 (it may also be on our 2003 servers, although I haven't noticed...)


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.