How to List Currently Logged-on Users on Windows
Knowing which users are currently logged on to a Windows machine can be helpful for system administrators, IT support, and security purposes. This guide provides several methods to list logged-on users using built-in Windows tools and via commands.
Why Check Currently Logged-on Users?
- Monitor Active Sessions: Identify who is using the system.
- Troubleshoot Issues: Diagnose login-related problems or performance bottlenecks.
- Security Checks: Ensure no unauthorized access has occurred.
Methods to List Currently Logged-on Users
1. Using Task Manager
- Press Ctrl + Shift + Esc to open the Task Manager.
- Click on the Users tab.
- You will see the list of logged-on users, their session types, and their statuses (e.g., active or disconnected).
2. Using Command Prompt
- Open Command Prompt:
- Press Win + R, type
cmd
, and press Enter.
- Press Win + R, type
- Use the following commands:
query user
: Displays the list of active sessions and users.whoami
: Shows the username of the current user.net user
: Lists all user accounts on the system, though it does not indicate logged-on users.
3. Using PowerShell
Open PowerShell:
- Press Win + R, type
powershell
, and press Enter.
- Press Win + R, type
Run the following command:
Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName
- This command shows the currently logged-in user on the console session.
4. Using Event Viewer
- Press Win + R, type
eventvwr
, and press Enter. - Navigate to:
- Windows Logs > Security.
- Look for Event ID 4624 (logon events) to see who logged in and Event ID 4647 for logoff events.
5. Using Sysinternals Tools
- Download and install Sysinternals tools from Microsoft (if not already installed).
- Use the PsLoggedOn tool:
- Open Command Prompt.
- Run
psloggedon
to list currently logged-on users locally and remotely.
6. Using Remote Desktop Services (RDS)
If using an RDS server or session host, use the Remote Desktop Services Manager or
qwinsta
command to list users logged into terminal sessions:qwinsta
Frequently asked questions:
-
Can I see all users logged into a remote machine?
Yes, tools like "qwinsta" or Sysinternals’ PsLoggedOn can list logged-on users on a remote machine.
-
How do I find disconnected sessions?
Use the Task Manager under the Users tab or the "query user" command to identify disconnected sessions.
-
Are logon events recorded in Windows?
Yes, logon and logoff events are logged in the Security logs of the Event Viewer.
-
Why are multiple users shown as logged on?
In systems with Remote Desktop enabled or multiple user accounts, several users can have active or disconnected sessions simultaneously.
-
Can I log off another user remotely?
Yes, using the logoff command with administrative privileges lets you log off another user session.