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.

2 thoughts on “Restarting Terminal Services

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

  2. Hello Brian, Here’s another tip (the more the merrier!)… With Microsofts’ Adminpak tools installed (whether from a client computer or server), using Terminal Services Manager, you are able to remote to any server’s terminal service, and reset any sessions live on the RDP-Tcp protocol (This will close all connected sessions within the server). Or you may even single-right-click any live session and reset that session to free up a slot. Hope this helps!