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