How to List Currently Logged-on Users on Windows
Step-by-step guide to listing active Windows users using Command Prompt commands, Task Manager, Powershell, Event Viewer for system monitoring and management.
Keeping track of who’s logged into a Windows machine is crucial for system administrators, IT support teams and cybersecurity experts. Whether you’re monitoring user activity, troubleshooting access problems, or conducting regular audits, having a clear view of active user sessions can save you time and help avoid potential security issues.
This guide will walk you through various built-in methods and tools to quickly check who’s logged on in Windows
Why Check Currently Logged-on Users?
- Monitor Active Sessions: Find out who’s using the system right now.
- Troubleshoot Issues: Help diagnose any login problems or performance hiccups.
- Security Checks: Make sure there’s no unauthorized access happening.
Methods to List Currently Logged-on Users
1. Using Task Manager
- Press Ctrl + Shift + Esc to launch the Task Manager.
- Click on the Users tab.
- You’ll see a list of logged-on users, along with their session types and statuses (like active or disconnected).
2. Using Command Prompt
- Open Command Prompt:
- Press Win + R, type cmd, and hit Enter.
- Use these commands:
- query user: This shows you the list of active sessions and users.
- whoami: This command shows the username of the user currently logged in.
- net user: This lists all user accounts on the system, but it won’t tell you who’s logged on.
3. Using PowerShell
- Open PowerShell: -
- Press Win + R, type powershell, and hit Enter.
- Run this command:
Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName
This will show you the currently logged-in user on the console session.
4. Using Event Viewer
- Press Win + R, type eventvwr, and then hit 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 you haven’t already.
- Use the PsLoggedOn tool:
- Open Command Prompt.
- Run "psloggedon" to see currently logged-on users, both locally and remotely.
6. Using Remote Desktop Services (RDS)
- If you’re using an RDS server or session host, you can use the Remote Desktop Services Manager or the `qwinsta` command to list
qwinsta
Final Thoughts
Keeping track of logged-in users is pretty simple once you know the right tools to use. Whether you like to use Task Manager for a quick overview, command-line tools for some scripting magic, or Event Viewer for those in-depth logs, Windows has a variety of options to meet your needs. By incorporating these techniques into your regular system checks, you can enhance your troubleshooting efficiency and strengthen your organization’s security posture.
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.