Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for some ideas on how to disconnect, logoff, or reset a user's session in a 2008 Terminal Server (unable to login as the user either as it is completely locked-up). This is a production environment, so rebooting the server or doing something system-wide is out of the question for now. Any Powershell tricks to help us with this?

We've tried to disconnect, log the user off and reset the session as well as killing the session's processes too, directly from the same terminal server (from the task manager, Terminal Services Manager and the Resource Monitor) with no results.


UPDATE: We ended up rebooting the server as no other attempts that we could think of worked. I'll leave this question open hoping someone might have more information about this one issue, and it's potential fixes

share|improve this question
I have the exact same issue on my windows 2008 R2 SP1 Terminal servers. They just randomly hang and users are unable to logoff or logon to the server. I cannot log on localy as local admin or domain admin. The only way to connect to the server is using compmgmt.msc but even here I cannot see any issues in the event logs. At some stage I get a message saying the IMA service is not responding and the server has been removed from teh farm. The only way to resolve this is to reboot the server Hard. Power off and back on again. I have not been able to narrow the cause of this down to anything and i – user81969 May 19 '11 at 10:02
Potentially useful links for anyone encountering this issue going forwards – JohnLBevan Aug 22 '14 at 18:18

15 Answers 15

I want to share how I reset of the account without the need to reboot the server. First of all you need to have administrator access to the server. I use the following logon option: mstsc /v:servername /console /admin in order to access the server. Then in "Windows Taks Manager", go to the Users tab and proceed to do a right click over the account that you want to "Log Off", select log off. This should free the locked session used by that account.

share|improve this answer

What worked for me to resolve this same issue was to kill off all the processes running under the locked account from under Task Manager and then I was able to simply log off that account (from an Administrator account).

The user was then able to log back on under the account.

No reboot was necessary and no third party software needed to be downloaded.

share|improve this answer
-Thanks, saved me from rebooting the server! Really didn't want to kick everyone out during the workday because of 1 stuck session. – MAW74656 Apr 10 '15 at 15:57

You can start a cmd, do a query session, check the id of the session to be killed and then do a reset session. For instance, if with query session you get that the session name rdp-tcp#1 is the one you want to kill, then you can execute reset session rdp-tcp#1 and get it killed.

share|improve this answer
Thanks, but that didn't help either. – l0c0b0x Jun 14 '10 at 18:29

I suppose the same happened today on my Win2008R2 Terminal Server. Sympthoms were: 1. He phoned me with "'connecting' message just hangs forever". He's just a simple user so I can't expect detailed problem description. 2. Tried logging off/resetting session (which usually helps in these cases) - did not work. The session still hangs in the list with 'disconnected' status. 3. Tried killing all processes for that user - did not help. Session persists and refuses to get killed.

Solution was - connect as user (login with his credentials if you can reset his password or use some kind of remote assistance to see what happens on his computer) and see what happens in logon window. When connecting I clicked on RDP Client's 'details' button - and here it was, a error message that winlogon did something wrong, it was waiting for user to click on 'retry/ignore/etc' buttons and since it's the omnipotent winlogon it caused all that weird behavior.

p.s. I could not found any way to really force kill a session :(

share|improve this answer

We just had a similar issue with our Windows Server 2008 R2 Remote Desktop server. The user session showed "Active" when looking at RDS Manager, but did not have the associated session ID# or connected device showing (both were blank).

All of the tricks above did not resolve the issue. When connecting as the user in question, an error message came back stating that the Terminal Server was busy and to try again later or contact the administrator.

We wound up rebooting the server as well.

share|improve this answer

The simple answer is to run an elevated command prompt and type "Taskmgr" and then it will allow you to logoff the sessions under the USERS tab. It will not work without being in the elevated session.

share|improve this answer

It may be worth checking that the user doesn't have a credentials pop-up box hidden behind the remote desktop window with alt + tab.

A coworker was having the same issue; couldn't log-off, or reset, and all of his processes were manually shut down. When I tried to access the gui for the system he was remoting FROM, I found a credentials box hiding behind the remote session.

share|improve this answer

Maybe there is a process still running, blocking the logoff process. Check the still running processes for the affected user. Then kill process one by one to see witch one is causing the problem.

Check also the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Registry key that only needed Processes are started. In 64bit it is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run.

share|improve this answer

You can download the "Process Explorer" tool from Microsoft and use that to solve your problem. If you have the session IDs, you can find their respective processes. Then if a user session is disconnected, you can kill the process with Process Explorer.

share|improve this answer

Not exactly the same environment (we have 2012r2) but restarting the Hyper-V Virtual Machine Management service (VMMS) released the connection for me.

share|improve this answer

I'd the same situation: a Windows Server 2008 R2 with Remote Desktop Services, RDP connection set up to log off users after the session is inactive or disconnected 3 hours, and still some sessions remained locked. I tried to log them off with both Remote Desktop Manager and qwinsta/quser, with no success.

Here's how I resolved it:

  1. I've located the session ID with qwinsta.
  2. I've located the PID of winlogon.exe for the hung session with query process /ID:yourid.
  3. I've killed the process with taskkill /f /PID yourPID.

Way to go. I'd like otherwise to find a solution for this to not happen.

share|improve this answer

What worked for me was :

  • log on the server
  • open task manager
  • look for the user in the user tab
  • right-click, connect, enter the user password, I saw a 'Please wait' screen
  • press alt-tab, that logged me off from the server and logged off the user too
share|improve this answer

You need to click to on process and show process from all users and then you will be able to disconnect.

why don't to create a session policy under Remote desktop session host configuration end disconnected or idle session after certain interval.

share|improve this answer

Unfortunately. My user session was disconnected. The task manager did not show any processes runing as the user. I could not log the user off from the task manager. I tried reset session id command and ended up freezing up as well. I had to end up logging in in a different session as the administrator, deleting the account and re-creating a new one.

share|improve this answer

Have you tried to logoff de user from de Remote Desktop Services Manager? Go to Administrative Tools --> Remote Desktop Services --> Remote Desktop Services Manager and log off de session. It may work.

share|improve this answer

Your Answer


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.