Many people assume Windows has a single tidy command that prints every account on the machine, the way who does on Linux. In fact there is no built-in command that lists all local accounts in one clean column; the closest built-in tools are net user and query user, and each answers a different question. net user lists local user accounts, while query user lists accounts currently logged on to the machine.

Run either from Command Prompt or PowerShell, and remember that the exact wording of output and some menu labels can differ slightly between Windows versions and editions.

Local Accounts With net user

Open Command Prompt (search for cmd in the Start menu) and type:

net user

The command prints a header line, a column of account names, and a footer saying the command completed successfully. On a typical home PC you will see the account you created at setup, Administrator if it has been enabled, DefaultAccount, Guest (usually disabled), and WDAGUtilityAccount on systems with Windows Defender Application Guard. Those last few are built-in service accounts, not people, so do not panic when they appear.

To see details for one account, add the name:

net user YourName

That returns the full name, comment, country code, account active status, account expiration, last logon, logon hours allowed, local group memberships, and global group memberships. The Account active line tells you whether the account is enabled; No means it exists but cannot sign in.

Limits of net user

net user shows local accounts only. On a domain-joined machine it will not list domain accounts, and it will not show Microsoft accounts by their email address — it shows the local profile name instead. If you need the email behind a Microsoft account, check Settings > Accounts > Your info, or run whoami to see the current identity.

Logged-On Users With query user

If your real question is "who is using this computer right now", use:

query user

This returns a table with columns for USERNAME, SESSIONNAME, ID, STATE, IDLE TIME, and LOGON TIME. A console session is the person at the keyboard; rdp-tcp sessions are remote desktop connections. Idle time is shown in minutes or as a period like 1:23, meaning 1 hour 23 minutes since the last input. This is the fastest way to spot a forgotten remote session holding a file open.

An older equivalent is quser, which produces the same table. If the command returns "No User exists for *", nobody is logged on interactively, which is normal on a server sitting at the lock screen with no session.

When query user fails

On some Home editions the Remote Desktop services that query user relies on are not running, and the command errors out. In that case use Task Manager: press Ctrl+Shift+Esc, open the Users tab, and you will see each signed-in account with its CPU, memory and disk usage. That tab is also the place to sign another user off, though you should warn them first — an unsigned-off session can lose unsaved work.

PowerShell and WMI Alternatives

PowerShell gives you more control over the output. The cmdlet Get-LocalUser lists local accounts with columns for Name, Enabled, Description, and LastLogon, which is easier to read than net user and can be filtered:

Get-LocalUser | Where-Object Enabled -eq $true

That returns only accounts that can actually sign in. To list members of the administrators group, use:

Get-LocalGroupMember -Group Administrators

For a machine on a domain, Get-ADUser -Filter * lists directory accounts, but it requires the Active Directory module and appropriate permissions, so it will fail on a home PC.

If you prefer the older interface, this WMI query works in both Command Prompt and PowerShell:

wmic useraccount get name,fullname,disabled

The wmic tool is being phased out in newer Windows builds, so treat it as a fallback rather than a first choice.

A Worked Audit Example

Suppose you inherit a laptop and want to know who has used it. Start with net user and you see five names: your own, Administrator, DefaultAccount, Guest, and a name like jsmith. Two are built-in, so three are real profiles.

Next run net user jsmith and read the output. If Account active says Yes and Last logon shows a recent date, that account has been used. If it says No, the account exists but is disabled. Then run query user to see whether anyone is signed in now. Finally, open Settings > Accounts > Other users to see the same accounts in graphical form and remove any you do not recognise — but only after confirming with the machine's owner, because deleting a profile also deletes that person's files.

For a quick count of local accounts, pipe the PowerShell output:

(Get-LocalUser).Count

On a clean home install this typically returns between 4 and 6, most of them built-in.

Reading the Output Correctly

The names DefaultAccount, WDAGUtilityAccount, and Guest are system placeholders. DefaultAccount is a system-managed account used by some services; WDAGUtilityAccount only matters if Application Guard is in use. Neither is a sign of an intruder.

Microsoft accounts appear under the first five characters of the email address by default, sometimes with extra characters appended if the name is already taken. So alex. on the list may be alex.smith@example.com. To match them up, open Settings > Accounts and compare the display names.

If an account you did not create appears, check net user Name for the Last logon line before assuming the worst. A blank last logon usually means the account has never been used, which is common for accounts created by software installers.

Admin Rights and Remote Machines

Listing accounts does not require administrator rights, but some details do. net user Name may show incomplete information for other users unless you run the command from an elevated prompt: right-click Command Prompt and choose Run as administrator.

To list accounts on another machine on the same network, add the computer name:

net user /domain

lists domain accounts, while query user /server:ComputerName shows sessions on a remote machine, provided you have permission and the firewall allows it. Both fail with an access-denied message if your account lacks rights, which is the expected behaviour rather than a fault.

One last check: if you only need to confirm which account you are currently using, whoami prints the domain and username in one line, and whoami /groups shows every group your account belongs to — useful when a permission problem has you guessing.