Hi,
Then you will need a scripting solution. You can look into the command line
utilties csvde and ldifde.
You can use VBScript. If you are sure you want to change this for all user
objects in the domain, you can use ADO to retrieve the Distinguished Name
for all users, bind to each, modify the "company" attribute, and invoke
SetInfo to commit the change. If all users are in one or a few
containers/OU's, you can bind to the container, filter on user objects,
enumerate the users, modify "company", and SetInfo. For one OU:
' Specify container/OU.
Set objOU = CreateObject("LDAP://ou=Sales,dc=MyDomain,dc=com")
' Filter on user objects.
objOU.Filter = Array("user")
' Enumerate user objects.
For Each objUser In objOU
' Modify "company" attribute.
objUser.company = "New Company Name, Inc."
' Commit change.
objUser.SetInfo
Next
Or, using ADO to retrieve all users regardless of their location in the
domain:
' Use ADO to search the domain for all users.
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOOBject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
' Determine the DNS domain from the RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strFilter = "(&(objectCategory=person)(objectClass=user))"
strQuery = "<LDAP://" & strDNSDomain & ">;" & strFilter _
& ";distinguishedName;subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
' Enumerate all users.
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
' Retrieve user Distinguished Name.
strDN = objRecordSet.Fields("distinguishedName").Value
' Bind to the user object.
Set objUser = GetObject("LDAP://" & strDN)
' Modify "company" attribute.
objUser.company = "New Company Name, Inc."
' Commit change.
objUser.SetInfo
objRecordSet.MoveNext
Loop
Wscript.Echo "Done"