qwinsta
Display information about Remote Desktop Services sessions.
QUERY SESSION [sessionname | username | sessionid]
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER] [/VM]
sessionname Identifies the session named sessionname.
username Identifies the session with user username.
sessionid Identifies the session with ID sessionid.
/SERVER:servername The server to be queried (default is current).
/MODE Display current line settings.
/FLOW Display current flow control settings.
/CONNECT Display current connect settings.
/COUNTER Display current Remote Desktop Services counters information.
/VM Display information about sessions within virtual machines.
tscon
Attaches a user session to a remote desktop session.
TSCON {sessionid | sessionname} [/DEST:sessionname]
[/PASSWORD:pw | /PASSWORD:*] [/V]
sessionid The ID of the session.
sessionname The name of the session.
/DEST:sessionname Connect the session to destination sessionname.
/PASSWORD:pw Password of user owning identified session.
/V Displays information about the actions performed.
tsdiscon
Disconnects a Remote Desktop Services session.
TSDISCON [sessionid | sessionname] [/SERVER:servername] [/V] [/VM]
sessionid The ID of the session.
sessionname The name of the session.
/SERVER:servername Specifies the Remote Desktop Session Host server (default is current).
/V Displays information about the actions performed.
/VM Disconnects session on server or within virtual machine. The unique ID of the session needs to be specified.