Security Basics mailing list archives

Re: Export list of usernames WinNT and Win2K servers


From: Ansgar -59cobalt- Wiechers <bugtraq () planetcobalt net>
Date: Tue, 14 Dec 2004 01:24:41 +0100

On 2004-12-11 systemcracker () gmail com wrote:
In Linux/Unix you can less the passwd file and get a list of all the
users their usernames etc and have it be a regular text file.  I
would like to know if there is some way to get something similar for
Windows servers

on win2k and XP, you can do this:

pull up a command prompt (start>run>cmd)

and type

dir /b "c:\documents and settings" > c:\myfile.txt

this will output all usernames to c:\myfile.txt

it should work on NT and 2kserver.

It will work only on 2k, not on NT, since the latter creates the user
profiles in %SystemRoot%\profiles.

However, this is not what the OP asked for anyway, because it will give
just a list of local user profiles on that box, domain profiles may
reside in a completely different folder. Plus the list may contain users
that were already deleted (though their profiles were not) as well as
omit users, that haven't logged in for the first time (thus not having
their profile created). "net user" is the command to go with.

Regards
Ansgar Wiechers
-- 
"Those who would give up liberty for a little temporary safety
deserve neither liberty nor safety, and will lose both."
--Benjamin Franklin


Current thread: