The Windows net user command lets you list user accounts, inspect an account, and—when you have authorization and sufficient privileges—manage local or domain user accounts from Command Prompt.
The previous lesson, Windows Command #22 – whoami, answers “Which account is this terminal using?” net user answers a different question: “Which user accounts exist here, and what does Windows know about one of them?”
Start by listing local users
net user
Run net user with no username to display local user accounts known to the computer. The exact names depend on the machine and its configuration.
C:\> net user
User accounts for \\LAB-PC
-------------------------------------------------------------------------------
Administrator labtech Guest
The command completed successfully.
This example is fictional. It shows three local account names on a computer named LAB-PC.
Video 1: Complete net user walkthrough
Inspect one account
net user labtech
Adding a username asks Windows for details about that account. Depending on the account and system, the output can include whether the account is active, password-related settings, local group memberships, profile information, and recent logon data.
This is especially useful after whoami. First confirm the identity of the current shell, then use net user username to inspect the local account record.
Local computer vs. domain
net user
net user labtech
net user /domain
net user labtech /domain
Without /domain, net user normally works with the local computer’s account database. On a domain-connected system, /domain asks the command to work against the current domain instead. Domain queries depend on connectivity, permissions, and the organization’s directory configuration.
Video 2: Managing Windows accounts with net user
Account-management syntax
net user can also change accounts. These forms should be used only on systems you are authorized to administer:
net user trainee StrongExamplePassword! /add
net user trainee /active:no
net user trainee /active:yes
net user trainee /delete
The first example creates a fictional local account named trainee. The next two disable and re-enable it. The last deletes the account record. Administrative privileges are typically required for account changes.
For a real environment, follow the organization’s password policy and identity-management process rather than copying an example password.
Avoid exposing passwords in command history
Typing a password directly into a command can expose it on-screen, in documentation, screenshots, terminal history, or support logs. When possible, use approved administrative tools and workflows that do not leave credentials visible in plaintext.
Useful account questions
- Which account am I using?
whoami - Which local accounts exist?
net user - What information is stored for one account?
net user username - Which groups are in my current security token?
whoami /groups - Which domain accounts are visible?
net user /domainon an appropriate domain-connected system
Data-center troubleshooting example
A technician reaches a Windows management workstation and an application refuses to run under the expected service account. A sensible first pass is:
hostname
whoami
net user
net user serviceaccount
hostname confirms the computer, whoami confirms the current identity, net user confirms the local account list, and net user serviceaccount checks whether that local account record exists and how Windows reports it.
Video 3: Create a Windows user from Command Prompt
Built-in help
net user /?
net help user
Use the built-in help before making changes. Windows displays the available syntax and switches supported by the installed command.
Common beginner mistakes
- Confusing
whoamiwithnet user. The first reports the current identity; the second works with account records. - Assuming every account shown in an organization is a local account.
- Using
/domainon a computer that is not connected to the expected domain environment. - Attempting account changes from a non-elevated shell and assuming the syntax is wrong when permissions are the real issue.
- Putting real passwords into screenshots, notes, scripts, or training examples.
Practice
- Open Command Prompt.
- Run
whoami. - Run
net user. - Find your local account name if it appears in the list.
- Run
net user yourusernameusing your own account name. - Identify whether the account is active.
- Run
net user /?and find the description of/domain.
Previous Windows lessons
Windows Command #22 – whoami (Windows OS)
Windows Command #21 – getmac (Windows OS)
Windows Command #20 – hostname (Windows OS)
Reference
Microsoft’s net user command reference
Key takeaway
Use net user to list Windows user accounts and inspect account details from Command Prompt. Pair it with whoami when troubleshooting identity: one tells you who the shell is running as, while the other tells you what account records Windows knows about.

Leave a comment