Use the tsshutdn command to shut down and restart a Terminal server. If you do so, users are notified that their sessions will end and the server is shut down in a controlled manner. Microsoft recommends that you use the tsshutdn command instead of the Shut Down option on the Start menu to shut down a Terminal server. If you use the Shut Down option on the Start menu, users are not notified before their sessions are ended, and they may experience data loss on the client computer.
TSSHUTDN /?
TSSHUTDN [wait_time] [/server:server_name] [/reboot] [/powerdown] [/delay:log_off_delay] [/v]
The freeware SHUTDOWN utility by Andrej Budja.
You must have administrative credentials to run TSSHUTDN.
Using in the Start menu is not recommended for shutting down a terminal server. This method does not notify users before ending their sessions.
All connected sessions are notified that they are going to be shut down. Sessions that have applications with open files prompt the user to save the files. After initiating the logoff command, TSSHUTDN waits a specified interval (set by /delay) before ending all processes.
TSSHUTDN does not reboot the terminal server unless the /reboot option is specified.
Microsoft Windows Remote Desktop TSShutdn.exe Unauthenticated Shutdown
DoS
OSVDB ID: 15011
Disclosure Date: Mar 25, 2005
Description: Microsoft Windows Remote Desktop contains a flaw that may allow a remote denial of service. The issue is triggered if a users belonging to the same domain of the target machine and uses the TSShutdn.exe utility trying to shut down the server. There is no authentication check so the target machine will shut down.
Solution: Apply Windows XP SP2, as it has been reported to fix this vulnerability. Alternatively, Microsoft Corporation has released a patch for SP1 to fix this vulnerability.
To end all client sessions 60 seconds after notification, and then shut down the current terminal server 30 seconds after all of the users are logged off, type the following command at the command prompt, and then press ENTER:
TSSHUTDN /v
Users receive the following message:
System is shutting down in 60 seconds.
To end all client sessions 5 minutes after notification, and then shut down and restart the Terminal server 1 minute after all of the users are logged off, type the following command at the command prompt, and then press ENTER:
TSSHUTDN 300 /reboot /delay:60 /v
Users receive the following message:
System is shutting down in 300 seconds.
To end all client sessions 2 minutes after notification, and then shut down and restart a Terminal server named "Server8" 20 seconds after all of the users are logged off, type the following command at the command prompt, and then press ENTER:
TSSHUTDN 120 /server:server8 /delay:20 /v
Users receive the following message:
System is shutting down in 120 seconds.
none.