Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Windows' Remote Desktop to connect from a Windows 7 machine to a Windows XP one. Many times, I just hit 'X' on the window without logging off when I'm finished using it, and subsequent users on the remote machine can't login because I'm still logged in to the Administrator account (user switching is disabled and must stay that way).

Reference:

enter image description here

Is there any way that I can set it up so that when RDP is disconnected from the remote machine, the remote session is logged off automatically?

(I thought about using a script on the remote machine to log off whenever the RDP is disconnected, but I can't see how to detect that; there doesn't seem to be any event associated with it.)

Edit: As stijn suggested, I tried using this batch file to query the remote computer for disconnected users with quser and then logging them off with rwinsta. However it seems that these commands are specifically for Windows Server editions.

share|improve this question
    
batchfile found here should be usable, maybe with some tweaks: sumoc.com/blog/index.cfm/2008/3/10/… –  stijn Jun 27 '12 at 18:17
1  
and superuser.com/questions/399962/… –  stijn Jun 27 '12 at 18:24
    
@stijn I actually found that before I posted, but for some reason I always get "Access is Denied" and I can't figure out why.... –  HodofHod Jun 27 '12 at 18:26
    
"Acces id Denied" on what? maybe you should add that to the question as well –  stijn Jun 27 '12 at 18:27
    
@stijn For the Quser command. –  HodofHod Jun 27 '12 at 18:28

1 Answer 1

You could set a time limit for disconnected sessions. This isn't exactly what you asked for, but if you set a low time limit, it achieves a substantially similar result.

share|improve this answer
    
I don't see how this works if I don't have Windows Server 2008. –  HodofHod Jun 27 '12 at 18:32
1  
@HodofHod The option is available in Windows 7 as well, in the same location. It is also in Windows XP, but in a slightly different location. The tool to set it, gpedit.msc may not be available in all editions however. –  Iszi Jun 27 '12 at 19:21
1  
Ah, I found it. It was the "\Policies\" that threw me off... –  HodofHod Jun 28 '12 at 0:51

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.