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?

link|improve this question
Should the list include "Power Users"? Guests? Standard users that have been granted Admin-equivalent privileges? The distinction is not as strict as you may think. – grawity Oct 10 '11 at 12:02
I guess I pretty much want enabled standard users. In the scenario I need this for, the users are very unlikely to have created a bunch of accounts with weird privileges – David Oct 10 '11 at 13:22
feedback

1 Answer

up vote 1 down vote accepted

To list users, use the net user command:

net user

You output get 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

You output get 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.

link|improve this answer
Investigate the net command, it can do all kinds of things. This also works on servers. – mauvedeity Nov 3 '11 at 19:54
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.