How to manage Terminal Services through commend-line tools
Terminal Services not only can be managed through Graphical User Interface (Terminal Services Manager MMC), but can also be managed through command line tools. In some cases, command line tools would help systems administrators a lot for increasing the administrative efficiency. In this article, I will mention some of the most useful command line tools for administering Terminal Services. Be aware that Windows Server 2003 provides a lot more command line tools for Terminal Services for more advanced use.
To start command prompt, click “Start”, click “Run”, and enter “cmd”. All of the following operations should be performed in the command prompt. For any commend line tool, we could view help for syntax information by adding “/?” parameter. For example, to view syntax information of “dir.exe”, we could enter “dir.exe /?”. As the result, in this article I will only mention how to use the commend line tools, but not the syntax.
To use TSCON, we should provide the session id or name, destination session id, and password as parameters.
To use TSDISCON, we should provide session id or name, and specify the terminal server name of the session we wants to disconnect from as parameters.
To use LOGOFF to log off a terminal session, we should provide session id or name and server name as parameters.
To use RESET SESSION, we should provide session id or name and server name as parameters.
To send a message to a user on a specific server, we use:
msg “username” /server: “servername” “message”
We can also send a message to a specific session:
msg “sessionname” “message”
There 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 process
This option displays information of all or specific processes by session. The user can specify process id, session id or name as parameters.
b) query session
This option displays information of all sessions on a terminal server.
c) query termserver
This option displays information of terminal servers in the domain.
d) query user
This option displays information of users currently logged on to terminal sessions.
This 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.
This web is provided "AS IS" with no warranties.
Copyright © 2002-2017 ChicagoTech.net, All rights reserved. Unauthorized reproduction forbidden.