Tora130’s Blog

import and export user in Active Directory

Posted by: tora130 on: June 1, 2009

to import and export attribute in AD,

we can use LDIFDE and CSVDE,

the main difference between LDIFDE and CSVDE is we can modify AD attribute using LDIFDE but we can only import and export attribute in CSVDE.

but the problem with LDIFDE is, the format of export data is not in CSVmode,

the example of export data from CSVDE

objectClass,sAMAccountName,dn
user,Petergr,” CN=Peter Graham,OU=Newport,DC=cp,dc=com”
user,Janiebo,” CN=Janie Bourne,OU=Newport,DC=cp,dc=com”
user,Edgardu,” CN=Edgar Dunn,OU=Newport,DC=cp,dc=com”
user,Belindaha,” CN=Belinda Hart,OU=Newport,DC=cp,dc=com”
user,Mayja,” CN=May Jamieson,OU=Newport,DC=cp,dc=com”
user,Leroyot,” CN=Leroy Ota,OU=Newport,DC=cp,dc=com”

the example of export data from LDIFDE

dn: CN=Jane Doe,OU=Staff,DC=microsoft,DC=com
changetype: add
replace: extensionAttribute1
extensionAttribute1: Staff

the example of script to Edit AD data

Dim
oContainer Set oContainer=GetObject(“LDAP:// OU=marketing,DC=reskit,DC=com”)
ModifyUsers oContainer
‘cleanup
Set oContainer = Nothing
WScript.Echo “Finished”
Sub ModifyUsers(oObject)
Dim oUser
oObject.Filter = Array(“user”)
For Each oUser in oObject
oUser.Put “st”,”New York”
oUser.Put “streetAddress”,”825 Eighth Avenue”
oUser.Put “postalCode”,”10019″
oUser.Put “l”,”New York”
oUser.SetInfo
Next
End Sub


Leave a Reply


  • domain registration india: how do you know that you've been hacked ? you cant complain to anybody, my suggestion is, download a backtrack, and try to do some penetration testing
  • angad: just go to bluecoat.com, its just quite simple, you just have to know what you need to install, bottom of that, its just a computer, with software fo
  • Mr WordPress: Hi, this is a comment.To delete a comment, just log in, and view the posts' comments, there you will have the option to edit or delete them.