How to log off other users on Windows 11

 Windows 11 Sign out other userss.
Windows 11 Sign out other userss.

On Windows 11, you can share a computer with others, and each user can have an account to keep their files, settings, and applications separate. However, if someone forgets to sign out, the session will remain loaded into the system, wasting resources that can affect performance and power usage.

You can always ask the other person to sign back in and sign out, or you can perform this task if you know their credentials, but it takes extra steps and time that can break your workflow. However, there are some other easier ways that include logging off the user manually without signing out of your account through Task Manager, Command Prompt, and PowerShell.

In this how-to guide, I will show you the different ways to log off other users on Windows 11.

How to log out other users from Task Manager

To sign other users out of Windows 11, use these steps:

  1. Open Start.

  2. Search for Task Manager and click the top result to open the app.

  • Quick tip: You can also use the "Ctrl + Shift + Esc" keyboard shortcut or choose the "Task Manager" option from the Taskbar context menu.

  1. Click on Users from the left navigation page.

  2. Right-click the user and choose the "Sign off" option.

  3. Click the "Sign out user" button.

Task Manager sign off users
Task Manager sign off users

Once you complete the steps, the system will sign out the users and terminate that specific session.

How to log out other users from Command Prompt

To sign out users through Command Prompt on Windows 11, use these steps:

  1. Open Start.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to view current users and confirm the user "ID," and press Enterquery session

  4. Type the following command to sign out the other user and press Enterlogoff ID-NUMBER 

In the command, replace "ID-NUMBER" with the number of the account you want to sign out. This example logs off the "user_demo" account with the ID of 2: logoff 2

Command Prompt logoff
Command Prompt logoff

After you complete the steps, the user will no longer be signed in on Windows 11.

How to log out other users from PowerShell

To sign out users through PowerShell on Windows 11, use these steps:

  1. Open Start.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to view current users and confirm the user "ID," and press Enterquery session

  4. Type the following command to query the computer and press Enter: hostname 

  5. Type the following command to sign out a specific user and press Enter: $sessionID = ((quser /server:'COMPUTER-NAME' | Where-Object { $_ -match 'USERNAME' }) -split ' +')[2]

In the command, change "COMPUTER-NAME" for the name of the computer and "USERNAME" for the name of the user to log off from the system. Here's an example on how the command should read: $sessionID = ((quser /server:'vmpreview' | Where-Object { $_ -match 'demo_user' }) -split ' +')[2]

PowerShell log off user
PowerShell log off user

Once you complete the steps, the PowerShell command will sign the user out of the system.

More resources

For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources: