Solved

Modify Active Directory using CSV File or CSV to LDIF Converter

Posted on 2006-10-25
5
3,613 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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