RE: Active Directory Password Script Error Trapping



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
.



Relevant Pages

  • Re: FTP: 421 Service not available....
    ... Or environment dependencies in your script. ... # Trap various errors ... logit "1. ... function exitfunc { ...
    (comp.os.linux.networking)
  • RE: Active Directory Password Script Error Trapping
    ... Should have thought of that seeing as though I've just setup the SSL ... > You should put an On Error Resume Next in your script, ... >> What I would like to know is how do I error trap this? ... >> Policy complexity rules (no idea what the error code for this is yet as this ...
    (microsoft.public.windows.server.scripting)
  • Re: transfering signals to a subshell
    ... > If you are at the command line and enter the command above, ... trap 2 3 ... Now I run test1 and press ^C immediately: ... The Script is rather long. ...
    (comp.unix.shell)
  • Re: Why does the system hungs?
    ... I tested that script on an linux machine, ... > In this case, we know what you mean (you have a trap message), but you ... That would be HTFS file system corruption, ... Dump not complete ...
    (comp.unix.sco.misc)
  • Re: Running a command for a limited time
    ... This does happen automatically, the signal is SIGCHLD. ... trap exit SIGCHLD ... trap "exit" SIGCHLD ... I adapted the latest script to bash and it works as advertised. ...
    (comp.unix.shell)