tags:

views:

84

answers:

2

Is there a way to enumerate all users on a local (NT-based) Windows box that can log in locally? Basically, I need a list of non-system users - this includes Administrator but excludes SYSTEM, LOCAL SERVICE and NETWORK SERVICE.

Edit: Yes, I need to do this from code. Since this is a programming website, I thought this was implied.

+2  A: 
NET USER
[username [password | *] [options]] [/DOMAIN]
         username {password | *} /ADD [options] [/DOMAIN]
         username [/DELETE] [/DOMAIN]

NET USER creates and modifies user accounts on computers. When used
without switches, it lists the user accounts for the computer. The
user account information is stored in the user accounts database.

Did you want to do it from code? The following discussion might help: http://www.codeproject.com/KB/system/EnumerateLocalUser.aspx

Joe Koberg
A: 

Simply use Net apis. See MSDN samples