Scripts to populate AD user information

Posted on 2005-04-15
Last Modified: 2008-05-30
Is there any script that can help me populate my user infomation in Active Directory with thier phone numbers?
I need to do this for about four thousand users and script would help. I have the current info in a text file.
Question by:Caddo65590
    LVL 87

    Assisted Solution

    Use the ldifde command line tool. If you just enter ldifde you'll get a list with the syntax. I'm not 100% sure if the utility is a part of windows server or if you have to install the resource kit.
    LVL 10

    Expert Comment

    Depends - Are you using Windows 2000 or 2003.

    I you are using windows server 2003, then the dsmod command should do the trick..
    You can also use dsquery and then use the results to populate AD using dsmod
    LVL 10

    Expert Comment

    basically you can take any ldap-modify-utility, as AD is simply an LDAP-Directory
    LVL 70

    Assisted Solution

    by:Chris Dent

    What format is the text file in? If possible post a sample of the data.

    Is the format the same throughout the text file?

    Finally, please post which properties you are trying to populate in the User Account?

    Author Comment

    All the user information is currently contained in a word document. The user data includes the following.
    Full Addresses
    Phone numbers and Faxes
    Organizational Info. Title etc
    We are using windows 2000 at the moment.
    I hope this info helps gives a much clearer picture.
    LVL 70

    Accepted Solution


    A word document isn't going to help too much from a scripting perspective.

    For this to be entered using any of the tools above or ADSI scripting the data needs to be in a pretty static format. A CSV file would be a good place to start because it is easily accessible and well structured (and a CSV is a text file).

    Something like these columns in Excel (saved as CSV):

    Full Name, Address1, Address2, Phone Number, Fax Number, Title, etc, etc

    Giving something roughly like:

    John Doe, IT Department, Building A, 0123456789, 0123456788, Director, etc, etc
    Rachel Smith, Marketing Department, Building B, 0123456666, 0123456788, Director, etc, ec

    A simple copy of the contents of the word document to a text file would also work, but the data still has to be predictable; a  static format.

    Finally, something is needed to tie a specific record (group of details) to the account in AD - for instance, if your usernames are First Initial and Last Name then it wouldn't be too hard to generate the AD Username from the Full Name. From that point it would be pretty easy to add the data to the right field.

    Basically, to script something to write the data in for you the data must be in a very predictable and accessible format. It must be possible to link the data in the sheet to an account in AD without requiring too much intelligence on the part of the script or any guesswork.
    LVL 87

    Expert Comment

    Why don't you just use

    ldifde -m -f filename.txt

    and your current AD will be output to the file "filename.txt"? You will then see how you should populate your file.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now