Solved

Modify Active Directory using CSV File or CSV to LDIF Converter

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

7 Experts available now in Live!

Get 1:1 Help Now