RE: Active Directory Password Script Error Trapping
- From: "DAS2" <DAS2@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Aug 2005 13:01:02 -0700
I wrote a similar asp page for our company. trap the error that same way you
would with any other script:
If err.number = xxx Then
'do something
Else
'do something else
End if
You should put an On Error Resume Next in your script, and you need the
error number instead of 8007202f. To get that, put the wrong password in and
this code:
vbscript:
wscript.echo err.number
asp:
response.write err.number
The hard part is getting the permissions to work using a webpage. Ever
heard of double-hop authintication? Arrrgggghhh!
I would also suggest that you auto generate the password for the user and
force the user to change password on next logon. That way, you know it will
meet your company's password policy and you don't have to write error
handling for that.
And I'm sure you already know, you will want to to make sure the page is SSL.
Hope that helps.
"Duckfather" wrote:
> Hi all
>
> I'm trying to write a web page to allows users to change their passwords
> from our Intranet. I have used the script found in the TechNet Script
> Repository for changing passwords successfully :-
>
> Set objUser = GetObject _
> ("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
> objUser.ChangePassword "i5A2sj*!", "jl3R86df"
>
> This works fine if all of the credentials are set ok.
>
> What I would like to know is how do I error trap this?
> I need to be able to trap if the old password is incorrect (returns error
> '8007202f') and also will need to know if the new password meets the Group
> Policy complexity rules (no idea what the error code for this is yet as this
> policy has yet to be implemented on our network).
>
> Any help would be greatly appreciated.
>
> Thanks in advance.
>
> Andy
.
- Follow-Ups:
- RE: Active Directory Password Script Error Trapping
- From: Duckfather
- RE: Active Directory Password Script Error Trapping
- References:
- Active Directory Password Script Error Trapping
- From: Duckfather
- Active Directory Password Script Error Trapping
- Prev by Date: Re: redirect STDOUT to a variable
- Next by Date: RE: redirect STDOUT to a variable
- Previous by thread: Active Directory Password Script Error Trapping
- Next by thread: RE: Active Directory Password Script Error Trapping
- Index(es):
Relevant Pages
|