How to Automatically Log Off Disconnected Remote Desktop / Terminal Services Sessions

Posted At : March 10, 2008 9:29 AM | Posted By : Cameron
Related Categories: Productivity

I've frequently heard complaints about people forgetting to log off when they end a Remote Desktop session. Instead they simply close the window, leaving their session running on the server. This orphaned session becomes a problem in many cases because Windows Servers are typically only licensed for two simultaneous logged in users. Even worse, if you can't remote into the box, you may not be able to easily identify the culprit(s) who left their sessions active. This leaves you no-one to throw things at and generally a very grumpy person.

Fortunately there is a solution to this problem...

You can configure Terminal Services to terminate abandoned sessions fairly easily on Windows 2000 and 2003 servers by doing the following:

  1. On the server, go to "Start > Programs > Administrative Tools > teminal Services Configuration"
  2. Select "Connections", then right click on RDP-Tcp and select Properties
  3. Select the Sessions tab and Check the "Override user settings" checkbox.
  4. Choose the criteria under which you'd like to start killing off sessions.

That does it!

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Dan Roberts's Gravatar thanks, that is helpful. We seem to run into this every few months
# Posted By Dan Roberts | 3/10/08 9:03 PM
Lee's Gravatar This is good info. I think this will help!
# Posted By Lee | 4/8/09 4:57 PM
Felipe's Gravatar Thanks mate, I've been looking for this for months!
# Posted By Felipe | 4/26/09 11:59 AM
Pantera975's Gravatar This wouldn't work for me.. not sure why. I made a batch file that does the trick.. just copy / paste it to Kill_Disconnects.bat and set it as a scheduled task

@echo off
Quser /server:XXXXXXXX > loggedon.txt
for /f "tokens=2" %%a in ('"FIND "Disc" loggedon.txt"') do set User=%%a
IF NOT %User%==LOGGEDON.TXT rwinsta /server:XXXXXXXX %User%
# Posted By Pantera975 | 5/22/09 11:18 AM

Recent Entries

Archives By Subject

Tech Blogs

(Mostly) Not Tech Blogs