I'm using the ASP script below to change a user's password by calling ADSI. This works fine as long as the user follows all the enforced rules for password creation. If they don't I get a very general error that I'm displaying with err.description. The error states:
450, Microsoft VBScript runtime error, , Wrong number of arguments or invalid property assignment
It occurred because I entered a password I used previously.
How can I get a more specific error to display for the user?
Thanks.
Code:
Set usr = GetObject("WinNT://rockit/" & ltrim(rtrim(Request.Form("usr"
)) & ",user"
usr.ChangePassword (Request.Form("OLDpw"
, Request.Form("NEWpw"
)
If Err <> 0 Then
PassOK = 0
Response.Write "Error occurred " & Err.number, Err.Description, err.Source, err.helpfile & "<P>"
Else
Response.Write "Password successfully changed"
PassOK = 1
End If
set usr = nothing
If PassOK = 0 Then Response.Write "An Error Occurred. Password Not Updated.<br>" & Err.number & ", " & Err.Source & ", " & err.helpfile & ", " & Err.Description
450, Microsoft VBScript runtime error, , Wrong number of arguments or invalid property assignment
It occurred because I entered a password I used previously.
How can I get a more specific error to display for the user?
Thanks.
Code:
Set usr = GetObject("WinNT://rockit/" & ltrim(rtrim(Request.Form("usr"
usr.ChangePassword (Request.Form("OLDpw"
If Err <> 0 Then
PassOK = 0
Response.Write "Error occurred " & Err.number, Err.Description, err.Source, err.helpfile & "<P>"
Else
Response.Write "Password successfully changed"
PassOK = 1
End If
set usr = nothing
If PassOK = 0 Then Response.Write "An Error Occurred. Password Not Updated.<br>" & Err.number & ", " & Err.Source & ", " & err.helpfile & ", " & Err.Description