Windows – List members of a Windows group using command line

command lineuser-accountswindows

I would like to get a list of "normal" users in the Windows command line. By normal, I mean the users that appear when logging on to the computer. Thus, disabled accounts, accounts like System, and others that an average PC users would never log into, would not be in this list. I also need to know whether the users returned were admins or standard users. Any ideas?

Best Answer

To list users, use the net user command:

net user

Your output will look something like this:

User accounts for \\LOCALHOST

-------------------------------------------------------------------------------
joeuser          administrator                   guest
The command completed successfully.

If you need a list of users in a specific group, the use net localgroup:

net localgroup Users

Your output will look something like this:

Alias name     Users
Comment        Users are prevented from making accidental or intentional system-wide changes and can run most applications

Members

-------------------------------------------------------------------------------
NT AUTHORITY\Authenticated Users
NT AUTHORITY\INTERACTIVE
The command completed successfully.

This is for local system users, not domain accounts. If you want to know the membership of the Administrators group, you would just supply that as a parameter: net localgroup Administrators.

Related Question