察看连接:qwinsta
用法: Display information about Terminal Sessions.
QUERY SESSION [sessionname | username | sessionid] [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER]
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 Terminal Services counters information.
用法示例:qwinsta /server:test-machine 显示结果 SESSIONNAME USERNAME ID STATE TYPE DEVICE console 0 Conn wdcon rdp-tcp 65536 Listen rdpwd Gogboy 1 Disc rdpwd Sunny 2 Disc rdpwd 这个结果显示有两个普通用户(Gogboy, Sunny)保留着对该机器(test-machine)的会话。可以通过下面的rwinsta段开
断开连接:rwinsta 用法: Reset the session subsytem hardware and software to known initial values.
RESET SESSION {sessionname | sessionid} [/SERVER:servername] [/V]
sessionname Identifies the session with name sessionname. sessionid Identifies the session with ID sessionid. /SERVER:servername The server containing the session (default is current). /V Display additional information.
用法示例:rwinsta 2 /server:test-machine 这样就把上面用户Sunny的会话从该机器断开了。
查看更多关于利用qwinsta和rwinsta查看和断开会话 - Windows操作系的详细内容...