Microsoft KB Archive/321703

= HOW TO: Connect to Another Session by Using the TSCON Command in Windows 2000 Terminal Services =

Article ID: 321703

Article Last Modified on 10/31/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q321703



IN THIS TASK
SUMMARY
 * Description of the TSCON Command
 * How to Connect to Another Terminal Services Session

REFERENCES



SUMMARY
This article describes how to connect to another existing Terminal Services session by using the tscon command in Windows 2000 Terminal Services.

You can use the tscon command to connect to another Terminal Services user session. You can connect to sessions that are in an active or disconnected state. When you connect to another session, you are disconnected from your previous session. If you create more than one session on a server, you can use this option to switch between the sessions.

back to the top

Description of the TSCON Command
The tscon command uses the following syntax:

tscon  |   [ /server: ] [/dest: ] [/password: ] /v

The parameters for the tscon command are:
 *  : Use this parameter to specify the ID of the session to which you want to connect. To determine the ID of the session to which you want to connect, use the query session command.
 *  : Use this parameter to specify the name of the session to which you want to connect. To determine the name of the session to which you want to connect, use the query process command.
 * /server: : Use this parameter to specify the Terminal Services server that hosts the session to which you want to connect. If you omit this parameter, the current Terminal Services server is specified.
 * /dest: : Use this parameter to specify the name of the session. When you connect to another session, this session is disconnected. You can use this parameter to connect the session of another user to a different session.
 * /password: : Use this parameter to specify the password of the user who owns the session to which you want to connect. You must use this parameter to specify the password if you are not the owner of the session.
 * /v: Use this parameter to display information about the actions that are being performed.

NOTE: You can connect to your own sessions, but if you want to connect to another user's session, you must use that user's password and you must have either Full Control or User Access permission. You cannot use the tscon command to connect to the console session.

back to the top

How to Connect to Another Terminal Services Session
This is an example of how to use the tscon command to connect to another session on the current Terminal Services server:  In a Terminal Services session, click Start, and then click Run. Type cmd, and then click OK. Determine the name or ID of the session to which you want to connect. To do so, type query session, and then press ENTER. You see a list of information about the sessions on the current Terminal Services server. The list may be similar to this:

SESSIONNAME  USERNAME        ID      STATE    TYPE    DEVICE 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   disc     rdpwd 6  idle 7  idle

Note that in this example, the name of the current session is rdp-tcp#1, the session ID is 1, and the session is owned by user1.

 To connect to session 2, type the following line at the command prompt, and then press ENTER:

tscon 2 /v

You see the following line:

Connecting sessionID2 to sessionname rdp-tcp#1

The current session (session 1) is disconnected, and you are connected to Session 2.

 To connect to session 1 (from session 2), type the following line at the command prompt, and then press ENTER:

tscon 1

The current session (session 2) is disconnected, and you are connected to session 1.

 To connect session 5 to session 2 from another session, type the following line at the command prompt, and then press ENTER:

tscon 2 /v /dest:rdp-tcp#5

You see the following line:

Connecting sessionID2 to sessionname rdp-tcp#5

Session 2 is connected to session 5, and session 5 is disconnected.

</li> To connect to session 4 (which is owned by User3), type the following line at the command prompt, where  is the password for User3, and then press ENTER:

tscon 4 /password:

The current session disconnects, and you are connected to session 4.</li></ol>

back to the top

<div class="references_section">