Restarting Terminal Services

A common problem with Windows servers is remoting. Unless you pay a large amount of money, you can only have two terminal services connections per server for administration purposes. Sometimes people leave the office and accidentally stay connected, which ties up a connection and means no one else can connect.

Since most of our development and live servers are accessed remotely, this quickly becomes a big problem. Luckily, I found an article that can help in this situation. I know any Windows sysadmins out there have probably known about this for a long time, but I haven’t. Since I am in charge of a few development servers, I need to know these tricks.

UPDATE: Much better advice from Sebastian.

Hi Brian, I’m a Windows and Linux enterprise admin and software developer. tsshutdn will restart the server. Instead you can just ask who’s connected executing “quser /server:YOURSEVER” from another terminal server. Once you have the current sessionID numbers on the server, you can log them out with the command: “logoff /server:YOURSERVER SESSIONID”. I hope this helps you. regards, Sebastian.

tsshutdn <wait_time> /server:<server_name> /reboot /delay:<log_off_time> /v This will disconnect everyone remotely connected and then reboot terminal services.