Solved

Modify Active Directory using CSV File or CSV to LDIF Converter

Posted on 2006-10-25
5
3,520 Views
Last Modified: 2012-05-05
I have 700+ users and need to phone numbers and addresses for all of them.

I have exported the users using CSVDE and have made the modification. Now I need away to import this back in Active Directory.

Does anyone have a script that I can use to convert CSV to LDIF and import them in one file?

0
Comment
Question by:LCH-IT
  • 3
  • 2
5 Comments
 
LVL 51

Expert Comment

by:Netman66
ID: 17807614
Save the CSV using Excel as a Comma Delimited text file - but only the username, phone number and address (just the fields you want to enter/change along with the associated username).

Post just the first line of this file (using bogus info) but preserve the format and way the user is being displayed.  If the first line is headers, delete it from the text file as we only want user info - one line per user with only the info that needs to be entered/changed.

I'll write something using the DS Tools in the Support Pack.  This should be fairly simple.

0
 

Author Comment

by:LCH-IT
ID: 17811825
Won't you need the DN? Here is a sample with the DN:

DN,c,l,st,postalCode,telephoneNumber,displayName,co,streetAddress
"CN=MSOTest,OU=Accounts - No Mailboxes,OU=Disabled Accounts,OU=Domain Accounts,DC=DOMAIN,DC=DOM,DC=int",US,Baton Rouge,LA,12345,(800) 800-8000,MSOTest,United States,123 Main Street

0
 
LVL 51

Accepted Solution

by:
Netman66 earned 500 total points
ID: 17812392
No, I can get that in the script.

It looks like I cannot address these attributes in AD with the standard tools - not all of them anyways.

I don't think you can convert from one format to the other, but can't you export with LDIFDE?

ldifde -f ExportUser.ldf -s BigServer -r "(objectclass=user)" -l "dn,c,l,st,postalCode,telephoneNumber,displayName,co,streetAddress"

Make your changes to this file.  Modify the Changetype: to modify.

A sample of the file is like so:

dn: CN=User1,OU=Test,OU=Site,DC=domain,DC=com
changetype: modify
add: c
c: US
-
add: l
l: Los Angeles
-
add: st
st: California
-
add: postalCode
postalCode: 12345
-
add: telephoneNumber
telephoneNumber: (800) 800-8000
-
add: co
co: United States
-
add: streetAddress
streetAddress: 234 Microsoft Way
-


Import like so:  ldifde -i -f import.ldf -s servername

Unless someone can write a vb script to pull out your values and write the output file you'll have to work from the exported LDF file.

0
 

Author Comment

by:LCH-IT
ID: 17812431
Thanks for trying. I found this program that will do it for me. Check it out www.novell.com/coolsolutions/tools/14462.html 

I figured out what was going wrong. Once it makes the LDIF, I have to modify the DN. All my users are "Lname, Fname" and the DN list it as DN: CN=Lname\\, Fname. I changed it to only one slash and it works.

Thanks for trying. I will award you all the points!
0
 
LVL 51

Expert Comment

by:Netman66
ID: 17812966
Wow...that's interesting.  A tool from Novell for this.  Great job - and thanks for posting it.  It'll be in my Favorites now!

NM
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
Learn about cloud computing and its benefits for small business owners.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 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