TSSHUTDN.exeThere is a wait_time parameter for TSSHUTDN.exe, which is really useful. Don’t terminate users’ session immediately. Set wait_time to 60 – 90 seconds will allow users to save their work. Default value is 60 seconds. REBOOT and POWERDOWN parameters are also very useful as REBOOT will reboot the server after shutting down, POWERDOWN will prepare the server to power off.

QUERY.exe is a powerful command can be used to query process, session, terminal servers, and user.

a) query processThis option displays information of all or specific processes by session. The user can specify process id, session id or name as parameters.b) query sessionThis option displays information of all sessions on a terminal server.c) query termserverThis option displays information of terminal servers in the domain.d) query userThis option displays information of users currently logged on to terminal sessions.

TSKILL.exeThis command kills specific process on a terminal session. For example, by entering TSKILL processid it will kill the process with the specific process id; by entering TSKILL processname it will kill the process with the specific process name. The SERVER parameter can be used to specify to kill the process on a specific server. The ID parameter can be used to specify a specific session.