In a Windows domain it's very simple to check what users are currently logged in on a server or client computer, and remotely leg them out if their session is frozen or they simply need to be logged out.
We can use the following commands on any domain joined computer, we just need to have admin privileges for certain actions, like logging users out. Naturally a regular user will not be able to log out any fellow users from remote or local machines.
1. List the user sessions on the remote server
qwinsta /server:mb02 # or query user /server:mb02
EXAMPLE:
Here, we see user "Alice" being logged in with session ID of 3 on server "mb02".
Alternatively you can use the "query user" command to list logged in users on the remote server. This command is useful if you want to see the logon times too:
2. Log a user out
If we want to log her out, we use the following command:
logoff 3 /server:mb02
Enjoy 🙂
Comments