Part of my job involves me having to log in to Windows servers for one reason or another. Unless the machine has died, it is usually easiest and quickest to do this from my desk. However… often other people forget to log off from the same server, and take up all the connections, meaning that there are none left to use to log in. Usually this requires a physical trip to the machine to chuck them off. But no longer….!
This blog post gives a great way of doing it locally, by bringing up a command prompt for the remote server, and then killing anyone who is logged in, but disconnected. For my own reference, here are the things to do:
- Download PsTools from Microsoft
- Run: psexec \\x.x.x.x -u user -p password cmd (e.g. psexec -u DOMAIN\user -p ******* cmd)
- Type ‘qwinsta‘ on the remote server to list the logged in users
- Type ‘logoff 2 /v‘ (replace the ‘2’ with the relevant session number)
No more wasted time walking to the machine room!