|
Not many people know about the command line tools for managing terminal server sessions in Windows. These are good for scripting and automation. They are available on Windows 2000, XP, and 2003 machines and can be used to disconnect and view terminal server sessions, respectively. Qwinsta is used to view all the sessions on a terminal server. For qwinsta, you'd open a command prompt, then enter: qwinsta /server:192.168.1.1 (where 192.168.1.1 is the IP address of the target server) You'll get output that lists all the current terminal server sessions. In that output with be an ID field, which lists the ID for each session. Take note of the ID of the session that you want to reset. Rwinsta is used to reset a particular terminal server session. To use it, from the command prompt, enter: rwinsta /server:192.168.1.1 2 (where 192.168.1.1 is the IP address of the target server) Notice the extra 2 at the end of the above command. That is the ID of the session that you want to reset. Once that is executed, it will reset the connection. There is also tsdiscon. This can be used to disconnect sessions, to use this, open a command prompt and type the following: tsdiscon 2 /server:192.168.1.1 /v (where 192.168.1.1 is the IP address of the target server, and 2 is the session ID of the session you want to disconnect) If you don't specify the /server switch to tsdiscon, it will disconnect the current local session - yeah, the one your logged into Remember, disconnecting is different than reseting, so remember which tool does which.
|