9

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

4 Answers 4

8

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

2
  • Exactly where it is - there is settings for log off when idle and another for logging off disconnected sessions.
    – Ryaner
    Apr 19, 2010 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, 2012 at 1:50
6

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.

2
  • 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. Jan 30, 2013 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, 2013 at 8:04
5

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.

3
  • Hi, The first part about Session Time Limits should be changed on local computer or the computer to which we remote desktop into?
    – pal4life
    Dec 1, 2016 at 20:59
  • Remote computer Jan 2, 2017 at 7:39
  • imgur.com/a/kE7Tpfe I've configured as your guide, but it still log me off.
    – Luke
    May 7, 2018 at 3:43
-1

delete the Default.rdp file under Documents folder. Thats all

if you want to delete specific settings: 1. Open the Run window (press Windows Key + R to bring up the Run Window, or right-click the Start menu and choose "Run") 2. Type regedit and press OK 3. In Registry Editor, expand: HKEY_CURRENT_USER > SOFTWARE > Microsoft > Terminal Server Client 4. Under the Terminal Server Client, there will be two keys: "Default" and "Servers". Delete both those keys if you want to delete all Remote Desktop Connection Data. • If you only want to delete a specific one, expand the "Default" key and delete the value type REG_SZ which should contain your Remote Desktop Server IP/HostName as Data. • Under the "Servers" key, there will be one key to delete for each Remote Desktop Server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .