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 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.
#5 by Dharmavirsinh Jhala on October 6, 2010 - 11:55 pm
Quote
Thanks Kyle.
Thanks for sharing…
Dharmavir
#6 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?
#7 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.
#8 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.