Windows remote session monitor and control

This tip would help you retrieve the list of users currently logged on to a remote windows server and disconnect any user if required.

To see the list of user sessions on a remote windows server, use either of the below queries.

“query session /SERVER:<servername or IP Address>”

or

“qwinsta /SERVER:<servername or IP Address>”

To terminate a session, note down the session ID from the output obtained from above commands. Execute below commands to terminate a session.

  1. “net user /user:<Administrator login> \\<servername or IP Address>\C$” . Enter password when prompted.
  2. Execute “reset session <ID> /SERVER:<servername or IP Address>” or use the command “rwinsta <ID> /SERVER:<servername or IP Address>”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.