There are many ways to determine who is currently logged in to a Microsoft Windows 10 computer. These are some common methods that you can use remotely or from the computer where you are trying to query.
You may use the “Auditing logon events” policy in Windows 10 to track login attempts, which can be useful in a variety of situations, such as determining who has been using your device without authorization, troubleshooting specific issues, and more.
When the policy is enabled, Windows 10 can track whether or not local and network logins are successful, and each event will contain the account name and the time it occurred, among other details. This function is usually designated for businesses, although anyone can use it if they understand how to utilize it.
In this Windows 10 tutorial, we’ll show you how to use Group Policy and the Event Viewer to view when and who has signed into your device.
On Windows 10, how do you enable the logon auditing policy?
If you have Windows 10 Pro installed, you can use the Local Group Policy Editor to enable the “Audit logon events” policy to keep track of successful and failed sign-in attempts on your device.
Important: Group Policy isn’t available in Windows 10 Home, however it’s worth noting that successful login auditing is enabled by default in this edition. You can skip these steps and go straight to the Event Viewer instructions if you’re using Windows 10 Home.
WhoAmI Command
The “whoami” command displays information about the current user you’re logged into and using in Windows.
- To bring up the Run window, hold down the Windows Key and press ” R“.
- To open a command prompt, type ” CMD” and then press ” Entry“.
whoami
- Type the following at the command prompt and then hit ” Enter“.
- Displayed is the computer name or domain, followed by the username.
Query User Command
This command will allow you to view all current users logged in to your computer.
Locally
- To bring up the Run window, hold down the Windows Key and press ” R“.
- To open a command prompt, type ” CMD” and then press ” Entry“.
- Type the following at the command prompt and then hit ” Enter“.
query user
- Displayed is the computer name or domain, followed by the username.
Remotely
- To bring up the Run window, hold down the Windows Key and press ” R“.
- To open a command prompt, type ” COMM” and then press ” Enter“.
- Type the following at the command prompt and then hit ” Enter“.
query user /server/computername
You can replace “computername” by the actual computer name for the system that you are querying. - Displayed is the computer name or domain, followed by the username.
Task Manager
- Right-click on the taskbar and select ” Task manager“.
- Select the tab ” Users“.
- The details of the users who logged in to the machine are shown.
WMIC
- To bring up the Run window, hold down the Windows Key and press ” R“.
- To open a command prompt, type ” CMD“, and then press ” Entry“.
- Type the following at the command prompt and then hit ” Enter“.
WMIC /NODE:"computername" COMPUTERSYSTEM GET USERNAME
You can replace computername with the actual computer name for the system that you are querying. You can also substitute computername with the IP address.
WMIC /NODE:192.168.1.1 COMPUTERSYSTEM GET USERNAME