Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 5 down vote accepted

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

share|improve this answer
    
Exactly where it is - there is settings for log off when idle and another for logging off disconnected sessions. –  Ryaner Apr 19 '10 at 20:46
    
In addition there are settings in the user settings in active directory that will control timeouts for terminal services. –  Grant Jun 18 '12 at 1:50

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.

share|improve this answer

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.

share|improve this answer
    
One caveat to running via /ADMIN - you'll lose access to things like local drives or clipboard. So depending on the source and target of that big file being copied, this might not be optimal for other reasons! My proposed solution would be to establish a network share that the server can see, then create a one-off scheduled task to copy the file "unsupervised" via Robocopy or FTP. –  George Erhard Jan 30 '13 at 17:34
    
The question was regarding sessions ending prematurely not the transfer method so that is what I had addressed. Using /admin you could transfer with ftp, scp, http or any others and the console session would maintain even if RDP disconnected as long as the users didn't logout. If the server enforces an inactivity logout then yes using a scheduled task could be a method to circumvent that. –  ManiacZX Jan 31 '13 at 8:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.