LDAP request
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","user@contoso.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.
Free Windows Admin Tool Kit Click here and download it now
March 26th, 2008 1:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics