Managing Terminal Services from the command line

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Managing Terminal Services from the command line

You can manage users, sessions, processes, and terminal servers by using command-line utilities. The following table lists the Terminal Services administrative utilities that you can invoke from the command line.

Command Function

Change logon

Disables, temporarily, logons to a terminal server.

Change port

Changes COM port mappings for MS-DOS program compatibility.

Change user

Changes the .ini file mapping for the current user.


Removes user-specific file associations from a user profile.


Enables or disables flat temporary directories.


Logs off a user from a session and deletes the session from the server.


Sends a message to a user or group of users.


Displays the Remote Desktop Connection to establish a connection with a Terminal Server.

Query process

Displays information about processes running on a terminal server.

Query session

Displays information about sessions on a terminal server.

Query termserver

Displays a list of all terminal servers on the network.

Query user

Displays information about user sessions on a terminal server.


Registers applications to execute in a global context on the system.

Reset session

Resets a session to known initial values.


Monitors another user's session.


Connects to another existing terminal server session.


Disconnects a client from a terminal server session.


Ends a process.


Copies user configuration and changes profile path.


Shuts down a terminal server.

For information about other command-line utilities, see Command-line reference A-Z. For more information about manageability, see Management Strategies and Tools.