Have you ever tried to logon to a Remote Desktop session on a Windows Server and you get stuck on the following screen?
Well, here is a simple way you can remotely kill that RDP session through PowerShell so that you can logon to the server again…
1 | qwinsta /server:ServerName |
Sample Output:
Once you get the session ID, you can run the following to kick off the user’s session completely so that you can log into the server again:
1 | rwinsta SESSION_ID /SERVER:ServerName |
Note: The session will be completely removed from RDP and anything running will be lost, but most of the time, you don’t have to worry about losing anything as the whole reason to lose the session is because you cannot logoff of it normally.
Life is then good again as you can log into your RDP session. Yay!