When you use the TSDICON command to disconnect an active Terminal Services session, the session remains attached to the Terminal Services server, but in a disconnected state. Programs that were running remain running. You can subsequently reconnect to the same session and resume work without loss of data in the running programs.
When you type tsdiscon /?, you receive:
<b>TSDISCON \[sessionid | sessionname\] \[/SERVER:servername\] \[/V\]</b>
<b>sessionid</b> The ID of the session.
<b>sessionname</b> The name of the session.
<b>/SERVER:servername</b> Specifies the Terminal server (default is current).
<b>/V</b> Displays information about the actions performed.
NOTE: To disconnect another user's session, Full Control permission is required.
Example:To disconnect a session on the current Terminal Services server:
1. Open a CMD prompt.
2. Type query session. You will receive a display like:
console administrator 0 active wdcon
rdp-tcp 65536 listen rdpwd
>rdp-tcp#1 user1 1 active rdpwd
rdp-tcp#2 user1 2 active rdpwd
rdp-tcp#3 user2 3 active rdpwd
rdp-tcp#4 user3 4 disc rdpwd
rdp-tcp#5 user1 5 active rdpwd
3. To disconnect the current session, type tsdiscon. To disconnect session ID 2, type tsdiscon 2 /v, which will display Disconnecting sessionID 2 from sessionname rdp-tcp#2. To disconnection rdp-tcp#5, type tsdiscon rdp-tcp#5.