Windows : List logged-in users and kill session using command line

By | February 17, 2019

In some circumstances where you cannot use (or open) the task manager panel to see the logged in users on a system and need to terminate a opened session, you might need to know your way around the CLI to achieve this task.

Those simple steps will show you how.

1. Open the Command Prompt or PowerShell console with elevated privileges

2. Enter the following command to list the logged-in users (this command will display users with opened active or disconnected sessions) :

The output will look like this :

3. Then use the “logoff” command with the session ID to terminate the desired user session (example with the output above) :

Now the user should be out of the system, you may use “quser” again to validate.