Remote Desktop KeepAlive

If you are like me, and sometimes need to run lengthy scripts in a remote desktop session, the auto-disconnect feature can cause a bit of a pain. If you have the need to keep the session alive, you can enable or disable via the following:

Windows XP and Windows Server 2003
To work around this issue, follow these steps:1. Click Start, click Run, type gpedit.msc, and then click OK.
2. Expand Computer Configuration, expand Administrative Templates, expand Windows Components, and then click Terminal Services.
3. In the right pane, double-click Keep-Alive Connections.
4. Click Enabled, and then click OK.
5. Close Group Policy Object Editor, click OK, and then quit Active Directory Users and Computers.


  • Computer


  • notds

    yeah, but what if you want to keep a session in “active” state not “disconnected” state when you exit the RDP session?

  • Martin

    Any idea how I can keep teh session alive after the user has disconnected the RDP connection???

  • Exotic Hadron

    In my case, enabling the Keep Alive interval and setting it to 5 mins resulted in a negative way. Now that the RDP connection drops if my Wi-Fi connection gets re-established because of connection loss. With keep-alive enabled I have to manually re-establish RDP connection each time the W-Fi connection gets re-established. Any suggestions?
    With default settings the RDP kept active and I did not have to re-establish it.

  • Laurence Shone

    Tried this but it doesn’t work for me given the build of the machines I’m working on.

  • Iain

    terrific!!!!!!! Was a little bit different on windows 7 but the steps all the same. Thank you!