Categories: User Accounts

List user names in command prompt

To list the user names having accounts on the local system, you can run the following command from Command Prompt in Windows 11 or Windows 10.

net user

This lists local user accounts, not just users who are currently signed in.

List domain user accounts

If the computer belongs to an Active Directory domain, we can use /domain to list accounts from that domain:

net user /domain

The computer needs to be able to contact its domain controller.

Find the current user name

If you only want the account running the current Command Prompt, use:

whoami

This shows the domain or computer name followed by the user name.

Srini

Recent Posts

Manage Print Jobs in Windows 11 & 10 Using PowerShell

Use PowerShell to list, pause, resume, and cancel print jobs in Windows 11 and Windows…

5 days ago

Add New User Account from Command Prompt (CMD)

Create local or domain user accounts from Command Prompt in Windows 11 and Windows 10…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows Command Prompt (CMD)? This post explains…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find Windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago