In this guide, you will learn how to log off users from remote computers.
Users will often forget to sign out of their computers. This can be a problem if you need to reboot the computer or perform maintenance on it.
The good news is there is a built-in Windows command that can log off the users on a remote computer. These steps will work on Windows 10, 11, and Server OS versions.
Let’s check it out.
Step 1. Check Who is Logged on the Remote Computer
First, you need to use the quser command to see who is logged onto the computer and also get their session ID number. Open the command prompt and run the below command. Change pc1 to your target computer.
The above command will get all logged on users from pc1.
In the screenshot above, you can see user “adam.reed” and “robert.allen.da” is logged into PC1. Robert is disconnected and adam is Active. I’ll take note of the user’s ID numbers (1 and 2).
Step 2. Use The Logoff Command
Now that we have the session IDs we can use the logoff command to log out the users on the remote computer.
Logoff 1 /server:pc1
The above command will log off the user with session ID 1 from pc1.
Note: Even though the command has the /server switch it will work with client operating systems like Windows 10 and 11. In this example, pc1 is a windows 10 computer.
Now, if I run the quser command you will see adam.reed is no longer logged in.
How to Check Windows Server Uptime