Sometimes, you need to kill a remote desktop session on the server remotely. In this article, we will use qwinsta and rwinsta commands to list and kill the remote desktop session on the server.
Get All Remote Desktop Session
You can run the command qwinsta to get all Remote desktop session on the server. For the example, I want to get all session from the server named wowhvdev1.
Kill a Remote Desktop Session
After you get all session list from
rwinsta /server:wowhvdev1 RemoteID
You can replace the RemoteID with the ID that you get from qwinsta command.