mrstephenw (8th December 2009)
Hey!
Could anyone recommend some sort of script or application that will enable me to generate a list of usernames which are pulled from active directory.
I require an ability to extract both the first name and surname as well as the associated login name (possibly even password).
The format we use would be much like the following example: Stephen Walden = 'stephenw'
Your help would be much appreciated!
Steve
Holmfirth J I & N School
1. ldifde -f export.ldf -s Aserver (Where Aserver is your domain controller and export.ldf is the filename)
In theory you can export user accounts by just giving the filename, but I find you need the -s switch to connect to the server. (-s Aserver)
Type your ldifde commands in notepad, then save as a .bat file then execute your .bat file from DOS.
2. Adding filters with -r
Use the -r switch to filter your data, for example: the command to export only computer objects on a server called Aserver is:
ldifde -f ExportComputer.ldf -s Aserver -r "(objectclass=computer)"
Gradually add to your basic ldifde file, pay attention to the syntax e.g. "speech marks", commas
Exporting only the LDIFDE fields you want with -l (lower case L)
ldifde -f ExportUser.ldf -s Aserver -r "(objectclass=user)" -l "dn, cn, givenName, sn, department"
mrstephenw (8th December 2009)

Have you tried DumpSec?
Link: SystemTools.com - Windows NT/2000/XP/2003 System Management Software
Download and extract. Run DumpSec and select Report/Dump Users as Table. Move fields you want included in the report to the right hand side column. Click OK.
Click File/Save Report as enter a name/location and select format to save report to [I usually choose CSV]
mrstephenw (8th December 2009)
theres also csvde built into windows. not used it for a while so can't really remember the syntax of how to use it but i remember it being quite simple.

CSVDE: Usernames and Contacts only:
At the server run:
CSVDE -f C:\onlyusers.csv -r objectCategory=person
Will create a CSV file called onlyusers.csv in the root of C: on that server.
Hey!
Thanks for all your suggestions . . .
I particularly liked Dave P's suggestion to use DumpSec, I found this program to be just what I wanted and more. Well worth the 2meg download.
Some of the command line stuff needed further refinement once the content was generated, but DumpSec seemed to do the refinements easily without much effort.
Nice one, thanks for taking the time out to respond,
Steve
A simple one, from the command line :-
dsquery user -limit 0 | dsget user -display -upn
these two command in combination are a great tool for batch files, etc.
There are currently 1 users browsing this thread. (0 members and 1 guests)