
|
email this FAQ to a colleague
Q:
How do I confirm that password has been changed successfully using ADSI?
A:
Here is some code that uses ADSI to change a password and confirm the change.
On Error Resume Next
Set oUser = GetObject("WinNT://machinename/username")
oUser.ChangePassword "oldpassword", "newpassword"
oUser.SetInfo
Set oUser = Nothing
If (err.number <> 0) Then
' Failed
Else
'Success
End if
- Wayne Berry
|