Can’t end RDP disconnected sessions

Situation: We have a Windows 2012 R2 server as Remote Desktop Server. Once for a while, no one except administrator (blin in this case) can login. The Task Manager Status shows all users are Disconnected. the User doesn’t show the username.

If I run qwinsta.exe, it shows all users except administrator (blin in our case) are disconnected or down.

I can’t force these disconnected users sign off or end process in Task Manager. We do have Timeout policy setup.

The only way to fix is restart the server. What could be the problem?

Troubleshooting: After reviewing the RDS configuration, we find this RD server was configured as Standard Session with all RD roles. However, all other RD server have been removed from the system and this is a standalone RD Server. Unchecked “Do not use an RD Gateway server” may or may not fix the problem.

We fix the problem by removing the RD Gateway from the RD Services, which converts Standard Session t o Quick Session.

These are other fixes we have tried but they don’t fix the problem.

1. 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.

2. 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.

3. 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.

4. 1)Locate the session ID with qwinsta.
2)Kill all processes under the session taskkill /FI “SESSION eq 1” /F, assuming the session ID you wanted to end returned from qwinsta was 1.

5. 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.

6. My fix: On a different network sever i connected to the problem server via Computer Management tool, in open sessions I right clicked and closed every open file then was able to connect via mstsc

7. 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.

8. Use these commands

Use qwinsta to get a list of the Remote Sessions in the command window (Get the session Id of user to kick out):

qwinsta /server:SERVERIP

Use rwinsta to disconnect the remote session:

rwinsta /server:SERVERIP SESSIONID

Also you may want to change the default timeout for idle RDP connections

9. running under the locked account from under Task Manager and then I was able to simply log off that account (from an Administrator account).

10. I tried to end those 4 tasks assigned to this user. Be careful, because some tasks, most importantly csrss.exe, when killed, also would result in a reboot of the system. I skipped them and just killed some obvious RDP-tasks.

11. 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.

12. 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.

13. Locate the session ID with qwinsta.

Kill all processes under the session taskkill /FI "SESSION eq 1" /F, assuming the session ID you wanted to end returned from qwinsta was 1.

This worked on Server 2012 Version 6.2 Build 9200, I would expect it to work on all version of windows.

Published by

Bob Lin

Bob Lin, Chicagotech-MVP, MCSE & CNE Data recovery, Windows OS Recovery, Networking, and Computer Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com

Leave a Reply