hi at every body i try an LDAP request for modifying an user of active Directory but i failedcould you give me an sample please ?thank you
March 15th, 2008 12:23am
Hi adel.87, Based on my research, here is a simple example to modify some attributes of the user with LDAP request. In this example, the "user account is located in the service OU of contoso.com domain. Dim oContainer Set Container=GetObject("LDAP://CN=user,OU=service,DC=contoso,DC=com") ModifyUsers oContainer Set oContainer = Nothing WScript.Echo "Modify user information successfully" Sub ModifyUsers(oObject) Dim oUser oObject.Filter = Array("user") For Each oUser in oObject oUser.put "description","test" oUser.put "mail","email@example.com" oUser.put "telephoneNumber","111-222-333-444" oUser.Put "st","New York State" oUser.Put "streetAddress","USA" oUser.Put "postalCode","123456" oUser.Put "l","NYC" oUser.SetInfo Next Please note: you need to save it as .vbs file, and run it on the domain controller at least with the credential of Domain Admin. For more examples of user management in Active Directory, please refer to our MSDN website. http://msdn2.microsoft.com/en-us/library/aa705921(VS.85).aspx Hope it helps.
March 26th, 2008 1:33pm