6
1
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:
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.
batchfile found here should be usable, maybe with some tweaks: http://www.sumoc.com/blog/index.cfm/2008/3/10/How-to-autologoff-remote-Desktop-Users
– stijn – 2012-06-27T18:17:00.3331
and http://superuser.com/questions/399962/how-can-i-make-sure-that-users-log-out-of-remote-desktop-sessions-instead-of-jus
– stijn – 2012-06-27T18:24:21.523@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.... – Hod - Monica's Army – 2012-06-27T18:26:01.257
"Acces id Denied" on what? maybe you should add that to the question as well – stijn – 2012-06-27T18:27:32.003
@stijn For the Quser command. – Hod - Monica's Army – 2012-06-27T18:28:18.617