If you are one who has ever faced issues due to people disconnecting from the Windows Terminal Server (RDP) and not logging off? Then here is a small change you can make and it will auto-log-off Users after specific interval of disconnection.

User > Properties > Session
Open Local Users and Groups, select User and then right click and open Properties window. Click on Sessions tab. It will show up screen similar to one above. Change "End a disconnected session: <N>" to specific time you want after which a disconnected User Session will be logged off.
So basically this is a small trick to avoid issues while Users tends to forget to log-off their sessions.
I have faced problems in the past when maximum limit for Users to connect comes to an end and you don't have any choice but to Restart the server, even "mstsc /console" don't work..! I had such experience with one of the dedicated Windows server on 1and1.com.
Similar Posts:
- Installing Apache on Windows 2008
- This download has been blocked by your security zone policy
- MySQL5 Problem while creating new user – SQL Error (1133): Can’t find any matching row in the user table
- How to auto-restart Windows Service upon failure
- MySQL 5.5.8 – Problem while Creating new User (SQL Error (1364): Field ‘authentication_string’ doesn’t have a default value)
#1 by Michal on July 24, 2009 - 5:56 pm
Quote
Actualy there is yet one option how to shoot down the forgotten inactive sessions on the terminal server, even when you are not able to connect to the server that is affected, and you don't even have to restart the server.
The trick is to log on to any machine in the domain with domain administrator privileged account, and to run these commands:
query session /server:servername
this will list all the sessions on the mentioned server, including their state, so you can choose which ID of the session is the correct one to kill in next step.
reset session [ID] /server:servername
this will kill the session marked by the ID obtained in the previous step. Once this command is finished, you should be good to go to log on the terminal server again.
Hope this will help someone, and prevent in such occassion to restart the server, when it is not needed.
#2 by Dharmavirsinh Jhala on July 26, 2009 - 6:04 pm
Quote
Thanks Michal.
#3 by Joseph on October 12, 2011 - 11:36 pm
Quote
Very useful tip…Thanks!!
#4 by Malini on March 13, 2013 - 1:49 pm
Quote
Thanks.. it's very useful..
#5 by Kyle on October 6, 2010 - 12:34 pm
Quote
You can also open Terminal Server Manager from another server with Domain Administrative rights. Find the maxed out Terminal Server, and reset or logoff the sessions there. This is essentially the same thing as Michal reported, but via a GUI.
#6 by Dharmavirsinh Jhala on October 6, 2010 - 11:55 pm
Quote
Thanks Kyle.
Thanks for sharing…
Dharmavir
#7 by Troy on July 15, 2011 - 7:58 am
Quote
I have a similar problem but not due to User mistake. I have provided them with a RDP file for a particular application. However, when they exit the application, the RDP file only disconnects them. The RDP does not seem to log them out of the terminal server when it exits.
Any suggestions? Or have I misunderstood how the RDP file for a hosted application should work?
#8 by Dharmavirsinh Jhala on July 23, 2011 - 3:39 pm
Quote
Hi Troy,
Solution on this post is for those who want to auto-log-off when users disconnect terminal server. So in that case you just have to change "Sessions" setting for User's profile under Manage Groups and Users section of your Windows Server.
Basically what version of Windows Server are you running with? I have noticed with Windows Server 2008 R2, there is ability for new user trying to login can request Log off to another user when terminal license limit is reached, that request will log off requested user if he does not respond in 30 seconds. This will prevent restart of server when people forget to log-off and just disconnects from the server.
I hope this helps. Let me know if you still have some doubt.
#9 by TechA on January 18, 2012 - 9:15 pm
Quote
I have a similar issue. I have team members working on Terminal Servers, and I also have them connecting to an RDP session running just Skype on an app server, but I can't get the session to automatically log off. I'm not experiencing any licensing or space issues, rather my problem comes from how windows handles time stamps.
I noticed that because this session never actually logs off (unless done manually, or set up to eventually do it after a certain amount of time), the time stamp is later than the one they use as their host service. The problem with this is that then their windows profiles get reset on their main RDP connection. This deletes their e-mail setup etc.
I haven't yet found a way for Skype to be installed successfully on a Windows 2008R2 Enterprise server, so that's why the 2008R2 rdp session for Skype is being used.
If there was some way I could just default any disconnected session to automatically log off (not set to 1 minute) then this issue would be resolved.
#10 by sanjay on February 7, 2012 - 1:11 pm
Quote
i found issue in GUIS server using by NSN i did the same and the issue is fixed
#11 by Phil on May 16, 2012 - 7:07 pm
Quote
You can also do this on a per/server basis:
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
#12 by Dharmavirsinh Jhala on May 24, 2012 - 11:32 pm
Quote
Thanks Phil for showing up this way of doing it. I really appreciate your help.
#13 by Dmitry on May 31, 2012 - 12:10 pm
Quote
Thanks! Good solution!
#14 by CMarin on November 28, 2012 - 7:17 pm
Quote
The settings to disconnect are set to never- but the sessions are still disconcerting at 30 minutes where else can i turn this off ???
#15 by Dharmavirsinh Jhala on November 29, 2012 - 11:47 pm
Quote
What operating system are you using server 2008 or newer? Is everything on the network end proper?
Does it disconnects or logs you off?
#16 by DSB on February 13, 2013 - 3:21 pm
Quote
even if you're getting maximum connections error, you can still log in a admin, no need to restart..
start > run ? mstsc /admin and log in
#17 by Dharmavirsinh Jhala on February 19, 2013 - 10:42 pm
Quote
yeah that's true…figured that out later but big thanks for mentioning here – I missed that out.