Remote Desktop Services (Terminal Services) command-line tools reference

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Learn about the available Remote Desktop Services (Terminal Services) command-line tools, with descriptions and links for more detailed information.

Note

To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.

Command Description
change Changes the Remote Desktop Session Host server settings for sign in, COM port mappings, and install mode.
change logon Enables or disables logons from client sessions on an Remote Desktop Session Host server, or displays current logon status.
change port Lists or changes the COM port mappings to be compatible with MS-DOS applications.
change user Changes the install mode for the Remote Desktop Session Host server.
chglogon Enables or disables logons from client sessions on an Remote Desktop Session Host server, or displays current logon status.
chgport Lists or changes the COM port mappings to be compatible with MS-DOS applications.
chgusr Changes the install mode for the Remote Desktop Session Host server.
flattemp Enables or disables flat temporary folders.
logoff Signs out a user from a session on an Remote Desktop Session Host server and deletes the session from the server.
msg Sends a message to a user on an Remote Desktop Session Host server.
mstsc Creates connections to Remote Desktop Session Host servers or other remote computers.
qappsrv Displays a list of all Remote Desktop Session Host servers on the network.
qprocess Displays information about processes that are running on an Remote Desktop Session Host server.
query Displays information about processes, sessions, and Remote Desktop Session Host servers.
query process Displays information about processes that are running on an Remote Desktop Session Host server.
query session Displays information about sessions on an Remote Desktop Session Host server.
query termserver Displays a list of all Remote Desktop Session Host servers on the network.
query user Displays information about user sessions on an Remote Desktop Session Host server.
quser Displays information about user sessions on an Remote Desktop Session Host server.
qwinsta Displays information about sessions on an Remote Desktop Session Host server.
rdpsign Enables you to digitally sign a Remote Desktop Protocol (.rdp) file.
reset session Enables you to reset (delete) a session on an Remote Desktop Session Host server.
rwinsta Enables you to reset (delete) a session on an Remote Desktop Session Host server.
shadow Enables you to remotely control an active session of another user on an Remote Desktop Session Host server.
tscon Connects to another session on an Remote Desktop Session Host server.
tsdiscon Disconnects a session from an Remote Desktop Session Host server.
tskill Ends a process running in a session on an Remote Desktop Session Host server.
tsprof Copies the Remote Desktop Services user configuration information from one user to another.