The Net Command Line to List Local Users and Groups

4

Normally, we can find the list of local users or groups created on a windows system from User Accounts applet in Control Panel,

Control Panel User Accounts 600x315 - The Net Command Line to List Local Users and Groups
User Accounts in Control Panel

Or, more in detail in Computer Management MMC, which is my favorite place when checking things like this.

Users Groups in Computer Management 600x322 - The Net Command Line to List Local Users and Groups
Users and Groups in Computer Management MMC

But do you know you can actually get them more effectively through a built-in command line Net?

To get the list of local users on the computer, run

net users

C:\Windows\system32>net users

User accounts for \\C-20130201

------------------------------------------------------
Administrator            Guest                    Kent
The command completed successfully.

To get the very detail information about a particular user, including the password policies, login script used, and the local groups s/he belongs to, run

net users username

C:\Windows\system32>net users Kent
User name                    Kent
Full Name                    Kent Chen
Comment
User's comment
Country/region code          000 (System Default)
Account active               Yes
Account expires              Never

Password last set            01/02/2013 1:10:37 PM
Password expires             Never
Password changeable          01/02/2013 1:10:37 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   01/02/2013 1:10:37 PM

Logon hours allowed          All

Local Group Memberships      *Administrators       *HomeUsers
Global Group memberships     *None
The command completed successfully.

To get the list of local groups available, run

net localgroup

C:\Windows\system32>net localgroup

Aliases for \\C-20130201

-----------------------------------------------
*__vmware__
*Access Control Assistance Operators
*Administrators
*Backup Operators
*Cryptographic Operators
*Distributed COM Users
*Event Log Readers
*Guests
*HelpLibraryUpdaters
*HomeUsers
*Hyper-V Administrators
*IIS_IUSRS
*Network Configuration Operators
*Performance Log Users
*Performance Monitor Users
*Power Users
*Remote Desktop Users
*Remote Management Users
*Replicator
*SQLServer2005SQLBrowserUser$C-20130201
*SQLServerMSASUser$C-20130201$MSSQLSERVER
*Users
*WinRMRemoteWMIUsers__
*WSS_ADMIN_WPG
*WSS_WPG
The command completed successfully.

To get the list of members who belong to a specific group, run

net localgroup groupname

C:\Windows\system32>net localgroup administrators
Alias name     administrators
Comment        Administrators have complete and unrestricted access to the computer/domain

Members

---------------------------------------------------------
Administrator
Kent
MHNETWORK\Domain Admins
The command completed successfully.

What’s more powerful is that if you run the same net commands on a domain controller that hosts a lot more user accounts, groups than a local workstation holds, such as a command like below returns the full domain groups you have created in the same DC.

Net Group

Give it a try, if you have access to a domain controller.

4 COMMENTS

  1. Magnificent goods from you, man. I’ve take into
    account your stuff prior to and you’re simply extremely wonderful.
    I really like what you have bought right here, certainly like what
    you’re saying and the way in which through which you say it.
    You are making it entertaining and you still take care of to stay
    it smart. I can not wait to read far more from
    you. That is really a tremendous site.

LEAVE A REPLY

Please enter your comment!
Please enter your name here