I want my sessions to terminate when Remote Desktop disconnects.

Right now I'm doing this manually ala:

alt text

Where I'm selecting End session as the option to When a session limit is reached or connection is broken:.

I'd like to do this with a script, and I want to know what the registry key is that I can set to make this the default behavior.

link|improve this question

feedback

3 Answers

up vote 2 down vote accepted

You do not need to edit the registry to do what you want to do, you need to change the Group Policy. Run GPEDIT.MSC and under Local Computer Policy navigate to Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections and change the settings under Configure keep-alive connection interval. For an even finer adjustment you might also want to look under Session Time Limits and change the settings under Set time limit for disconnected sessions.

Update:

After some more searching I found some Group Policy Management Scripts provided by Microsoft. They come in an installer package which puts all the scripts (and a read me file) in your Program Files folder in a folder called Microsoft Group Policy. There are many scripts for doing different things, and I am sure one of them will do what you want. Without doing any more research on the subject it seems like the script CreateEnvironmentFromXML is what you will want to use. Here is the download link.

link|improve this answer
As I mentioned in the question I want to do this with a script. I have a large number of computers to set up and having to manually go through each one is a bit of a pain. – tzenes Oct 21 '10 at 16:07
ah, i see. i'll look into it a bit more. – typoknig Oct 21 '10 at 16:11
@tzenes I have added new information to my answer that might help you. – typoknig Oct 22 '10 at 2:59
feedback

Try fResetBroken in HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services

http://technet.microsoft.com/en-us/library/cc785966(WS.10).aspx

link|improve this answer
Didn't work.... – tzenes Oct 21 '10 at 16:06
feedback

Not a direct answer, but what I'd do is pull out Process Monitor and watch what happens when I click 'OK' on that dialog after toggling the setting needed.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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