远程桌面切换到其它的会话 switch to another (rdp or console) session

一般直接打开远程桌面(mstsc)后,连接到的rdp session都是不确定的,可能会提示选择最后连接过但现在已断开的会话。

可以使用 query 查看当前的session信息,包括session内process(进程),session list , session users 等

QUERY { PROCESS | SESSION | TERMSERVER | USER }

当想要切换到一个明确的会话(比如上次登录的会话)或 console session 时,使用下边的命名:

未连接到远程主机时,可使用下边的命令连接远程主机的console session

mstsc /admin (or mstsc /console in future)

当已连接到远程主机时,在远程主机 shadow 另一个 session。当前session不断开,需要得到目标session的许可(目标session会收到一个弹窗提示:是否允许控制当前会话?)

shadow <session_id>

当已连接到远程主机时,在远程主机上切换到另一个session。断开当前session,然后进入另目标session,是真正的切换。

tscon <session_id> | <session_name> 

REFER TO : tscon command
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.

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.


Refer to:
Sessions, Desktops and Windows Stations
smss.exe

发表评论

电子邮件地址不会被公开。