Code to Use the ProfileService Object or Commerce Server OLEDB Provider to Update Passwords

This section describes how to update passwords using different methods.

If you are using Active Directory to store passwords, then passwords must be configured as multi-valued properties. When the passwords are changed, the sequence of values must be ('<old password>', '<new password>'). The following SQL query example illustrates this:

UPDATE UserObject
SET GeneralInfo.user_security_password = ('<old-password>', _
                                         '<new-password>')
WHERE GeneralInfo.logon_name = '<logon-name>'

If you are using the ProfileService object, an array of values must be used. The old password must be the first element of the array; the new password must be the second element. The following example illustrates this:

Dim objProfile
Dim Passwords(2)

Passwords(0) = "<old-password>"
Passwords(1) = "<new-password>"
' <Code to create and initialize ProfileService object omitted>
Set objProfile = ProfileService.GetProfile("<logon-name>", "UserObject")
objProfile.GeneralInfo.user_security_password = Passwords
objProfile.Update

Copyright © 2005 Microsoft Corporation.
All rights reserved.