Platform SDK: Active Directory, ADSI, and Directory Services

Example Code for Setting User Passwords

The following Visual Basic® code snippet shows how to set the user password, assuming the caller has the permission to set the password.

Set usr = GetObject("LDAP://cn=foobar,cn=Users,dc=Microsoft,dc=com")
usr.SetPassword "topsecret98"