+ Post New Thread
Results 1 to 7 of 7
Windows Server 2000/2003 Thread, generate a list of usernames in active directory in Technical; Hey! Could anyone recommend some sort of script or application that will enable me to generate a list of usernames ...
  1. #1

    Join Date
    May 2007
    Posts
    43
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Question generate a list of usernames in active directory

    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

  2. #2

    Join Date
    Dec 2009
    Location
    Maidenhead
    Posts
    10
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    5

    Active Directory Export

    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"

  3. Thanks to hargz from:

    mrstephenw (8th December 2009)

  4. #3

    DaveP's Avatar
    Join Date
    Oct 2006
    Location
    Can't talk now: The mother-ship is calling!
    Posts
    4,491
    Blog Entries
    1
    Thank Post
    168
    Thanked 663 Times in 419 Posts
    Rep Power
    511
    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]

  5. Thanks to DaveP from:

    mrstephenw (8th December 2009)

  6. #4
    krisd32's Avatar
    Join Date
    Feb 2006
    Location
    Longridge, Preston
    Posts
    522
    Thank Post
    80
    Thanked 62 Times in 41 Posts
    Rep Power
    28
    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.

  7. #5

    DaveP's Avatar
    Join Date
    Oct 2006
    Location
    Can't talk now: The mother-ship is calling!
    Posts
    4,491
    Blog Entries
    1
    Thank Post
    168
    Thanked 663 Times in 419 Posts
    Rep Power
    511
    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.

  8. #6

    Join Date
    May 2007
    Posts
    43
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Beautiful :@)

    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

  9. #7

    Join Date
    Dec 2007
    Location
    cumbria
    Posts
    132
    Thank Post
    6
    Thanked 28 Times in 26 Posts
    Rep Power
    14
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Active Directory Alternative HOW-TO??
    By Joedetic in forum *nix
    Replies: 17
    Last Post: 26th January 2012, 11:46 PM
  2. Replies: 0
    Last Post: 6th April 2009, 11:26 PM
  3. active directory
    By Hamzah in forum Windows Server 2000/2003
    Replies: 6
    Last Post: 26th March 2009, 08:26 PM
  4. Active Directory
    By Neville in forum Windows
    Replies: 6
    Last Post: 25th June 2008, 04:24 PM
  5. Replies: 7
    Last Post: 31st January 2008, 01:17 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •