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
Solved

Modify Active Directory using CSV File or CSV to LDIF Converter

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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