Solved

Modify Active Directory using CSV File or CSV to LDIF Converter

Posted on 2006-10-25
5
3,453 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

28 Experts available now in Live!

Get 1:1 Help Now