ASP/ADSI Page to Change passwords

ASP/ADSI Page to Change passwords

Post by Jason Wils » Thu, 01 May 2003 05:20:54



1st off let me say that I have no knowledge of ASP, but am an old hand
at ADSI scripting.

The following two asp's are to allow external users to change their
windows 2000 AD password from a website hosted on IIS5.0 server:

This one (default.asp) gathers the necessary info (username, password,
new password and passes it to Changepassword.asp


<SCRIPT id=DebugDirectives runat=server language=javascript>
</SCRIPT>
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1 align=center>User&nbsp;Password&nbsp;Maintenance</H1>
<P>&nbsp;</P>
<P>Please enter your user name and New password below:</P>
<P>
<FORM action="ChangePassword.asp" method=post id=frmLogin
name=frmLogin>

<TABLE border=0 cellPadding=1 cellSpacing=1 width="75%">

  <TR>
    <TD>User Name</TD>
    <TD><INPUT id=txtUserName name=txtUserName
      style="HEIGHT: 25px; WIDTH: 365px">
</TD></TR>
  <TR>
    <TD>  Existing  Password</TD>
    <TD><INPUT id=txtPassword name=txtPassword
      type=password style="LEFT: 1px; TOP: 3px">
</TD></TR>
  <TR>
    <TD>  New Password  </TD>
    <TD><INPUT id=txtNewPassword name=txtNewPassword
      type=password>
</TD></TR></TABLE></P>
<P><INPUT type="submit" value="Submit" id=submit1 name=submit1>&nbsp;
</P></FORM>
<P>&nbsp;</P>

</BODY>
</HTML>

ChangePassword.asp

<%

'CALLOUT A
dim sUser, sPassword
dim oUser, sConnectString
'END CALLOUT A

'CALLOUT B
sUser = request("txtUserName")
sPassword = request("txtPassword")
sNewPassword = request("txtNewPassword")
if sUser = "" then Response.Redirect "ChangePasswordEntry.asp"
'END CALLOUT B

Response.Write "User name is: " & sUser & "  --  " & sPassword &
"<br>"

Response.Write "New Password is: " & sNewPassword & "<br>"

'CALLOUT C
sConnectString = "LDAP://carme/CN=" &  sUser &
",OU=users,ou=corp,dc=radnet,dc=ausrad,dc=com"
Response.Write "Connect string: " & sConnectString & "<br>"
'Set oUser = GetObject(sConnectString)
'END CALLOUT C

Response.Write "Logon user: " & Request.ServerVariables("LOGON_USER")
& "<br>"
Response.Write "User Password: " &
Request.ServerVariables("AUTH_PASSWORD") & "<br>"

'CALLOUT D
oUser.ChangePassword sPassword, sNewPassword
'END CALLOUT D

set oUser = Nothing

%>

The result I get is as follows -- can one of you web/adsi gurus give
me a hand.

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/ChangePassword1.asp, line 30

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)

Page:
POST 77 bytes to /ChangePassword1.asp

POST Data:
txtUserName=wilsonj&txtPassword=<omitted>&txtNewPassword=<omitted>&submit1=Submit

Thanks,
Jason

 
 
 

ASP/ADSI Page to Change passwords

Post by Richard Muelle » Thu, 01 May 2003 06:30:05


Hi,

Is line 30 (the line of ChangePassword1.asp that raises
the error) the line

oUser.ChangePassword sPassword, sNewPassword

and, if so, is the line

'Set oUser = GetObject(sConnectString)

commented out in the version you run?

Richard
http://www.rlmueller.net

Quote:>-----Original Message-----
>1st off let me say that I have no knowledge of ASP, but
am an old hand
>at ADSI scripting.

>The following two asp's are to allow external users to
change their
>windows 2000 AD password from a website hosted on IIS5.0
server:

>This one (default.asp) gathers the necessary info

(username, password,
>new password and passes it to Changepassword.asp


><SCRIPT id=DebugDirectives runat=server

language=javascript>
></SCRIPT>
><HTML>
><HEAD>
></HEAD>
><BODY>
><H1 align=center>User Password Maintenance</H1>
><P> </P>
><P>Please enter your user name and New password below:</P>
><P>
><FORM action="ChangePassword.asp" method=post id=frmLogin
>name=frmLogin>

><TABLE border=0 cellPadding=1 cellSpacing=1 width="75%">

>  <TR>
>    <TD>User Name</TD>
>    <TD><INPUT id=txtUserName name=txtUserName
>      style="HEIGHT: 25px; WIDTH: 365px">
></TD></TR>
>  <TR>
>    <TD>  Existing  Password</TD>
>    <TD><INPUT id=txtPassword name=txtPassword
>      type=password style="LEFT: 1px; TOP: 3px">
></TD></TR>
>  <TR>
>    <TD>  New Password  </TD>
>    <TD><INPUT id=txtNewPassword name=txtNewPassword
>      type=password>
></TD></TR></TABLE></P>
><P><INPUT type="submit" value="Submit" id=submit1
name=submit1>
></P></FORM>
><P> </P>

></BODY>
></HTML>

>ChangePassword.asp

><%

>'CALLOUT A
>dim sUser, sPassword
>dim oUser, sConnectString
>'END CALLOUT A

>'CALLOUT B
>sUser = request("txtUserName")
>sPassword = request("txtPassword")
>sNewPassword = request("txtNewPassword")
>if sUser = "" then

Response.Redirect "ChangePasswordEntry.asp"

- Show quoted text -

Quote:>'END CALLOUT B

>Response.Write "User name is: " & sUser & "  --  " &
sPassword &
>"<br>"

>Response.Write "New Password is: " & sNewPassword & "<br>"

>'CALLOUT C
>sConnectString = "LDAP://carme/CN=" &  sUser &
>",OU=users,ou=corp,dc=radnet,dc=ausrad,dc=com"
>Response.Write "Connect string: " & sConnectString
& "<br>"
>'Set oUser = GetObject(sConnectString)
>'END CALLOUT C

>Response.Write "Logon user: " & Request.ServerVariables
("LOGON_USER")
>& "<br>"
>Response.Write "User Password: " &
>Request.ServerVariables("AUTH_PASSWORD") & "<br>"

>'CALLOUT D
>oUser.ChangePassword sPassword, sNewPassword
>'END CALLOUT D

>set oUser = Nothing

>%>

>The result I get is as follows -- can one of you web/adsi
gurus give
>me a hand.

>HTTP 500.100 - Internal Server Error - ASP error
>Internet Information Services

>----------------------------------------------------------

----------------------

- Show quoted text -

Quote:

>Technical Information (for support personnel)

>Error Type:
>Microsoft VBScript runtime (0x800A01A8)
>Object required: ''
>/ChangePassword1.asp, line 30

>Browser Type:
>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.0.3705)

>Page:
>POST 77 bytes to /ChangePassword1.asp

>POST Data:
>txtUserName=wilsonj&txtPassword=<omitted>&txtNewPassword=<

omitted>&submit1=Submit

- Show quoted text -

Quote:

>Thanks,
>Jason
>.


 
 
 

ASP/ADSI Page to Change passwords

Post by Blak » Sat, 24 May 2003 23:17:28


I am getting the exact same error - did you ever get any kind of
response/fix?

Blake

> 1st off let me say that I have no knowledge of ASP, but am an old hand
> at ADSI scripting.

> The following two asp's are to allow external users to change their
> windows 2000 AD password from a website hosted on IIS5.0 server:

> This one (default.asp) gathers the necessary info (username, password,
> new password and passes it to Changepassword.asp


> <SCRIPT id=DebugDirectives runat=server language=javascript>
> </SCRIPT>
> <HTML>
> <HEAD>
> </HEAD>
> <BODY>
> <H1 align=center>User&nbsp;Password&nbsp;Maintenance</H1>
> <P>&nbsp;</P>
> <P>Please enter your user name and New password below:</P>
> <P>
> <FORM action="ChangePassword.asp" method=post id=frmLogin
> name=frmLogin>

> <TABLE border=0 cellPadding=1 cellSpacing=1 width="75%">

>   <TR>
>     <TD>User Name</TD>
>     <TD><INPUT id=txtUserName name=txtUserName
>       style="HEIGHT: 25px; WIDTH: 365px">
> </TD></TR>
>   <TR>
>     <TD>  Existing  Password</TD>
>     <TD><INPUT id=txtPassword name=txtPassword
>       type=password style="LEFT: 1px; TOP: 3px">
> </TD></TR>
>   <TR>
>     <TD>  New Password  </TD>
>     <TD><INPUT id=txtNewPassword name=txtNewPassword
>       type=password>
> </TD></TR></TABLE></P>
> <P><INPUT type="submit" value="Submit" id=submit1 name=submit1>&nbsp;
> </P></FORM>
> <P>&nbsp;</P>

> </BODY>
> </HTML>

> ChangePassword.asp

> <%

> 'CALLOUT A
> dim sUser, sPassword
> dim oUser, sConnectString
> 'END CALLOUT A

> 'CALLOUT B
> sUser = request("txtUserName")
> sPassword = request("txtPassword")
> sNewPassword = request("txtNewPassword")
> if sUser = "" then Response.Redirect "ChangePasswordEntry.asp"
> 'END CALLOUT B

> Response.Write "User name is: " & sUser & "  --  " & sPassword &
> "<br>"

> Response.Write "New Password is: " & sNewPassword & "<br>"

> 'CALLOUT C
> sConnectString = "LDAP://carme/CN=" &  sUser &
> ",OU=users,ou=corp,dc=radnet,dc=ausrad,dc=com"
> Response.Write "Connect string: " & sConnectString & "<br>"
> 'Set oUser = GetObject(sConnectString)
> 'END CALLOUT C

> Response.Write "Logon user: " & Request.ServerVariables("LOGON_USER")
> & "<br>"
> Response.Write "User Password: " &
> Request.ServerVariables("AUTH_PASSWORD") & "<br>"

> 'CALLOUT D
> oUser.ChangePassword sPassword, sNewPassword
> 'END CALLOUT D

> set oUser = Nothing

> %>

> The result I get is as follows -- can one of you web/adsi gurus give
> me a hand.

> HTTP 500.100 - Internal Server Error - ASP error
> Internet Information Services

> --------------------------------------------------------------------------
------

> Technical Information (for support personnel)

> Error Type:
> Microsoft VBScript runtime (0x800A01A8)
> Object required: ''
> /ChangePassword1.asp, line 30

> Browser Type:
> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)

> Page:
> POST 77 bytes to /ChangePassword1.asp

> POST Data:

txtUserName=wilsonj&txtPassword=<omitted>&txtNewPassword=<omitted>&submit1=S
ubmit

- Show quoted text -

Quote:

> Thanks,
> Jason

 
 
 

1. Enabling users to change their password via web page (ASP/ADSI)

Hi, I've seen many discussions on this subject but no solutions. I've
been trying to connect the users current user object using
opendsobject. Unfortunately, it seems to ingore using this account and
use the IIS web user account instead which will not have rights to
change users passwords.

If anyone has a working solution for this I would LOVE to see it. I've
been bashing my head against a brick wall for a couple of days now!

Thanks
Chris

2. What does a Direct-to-SOM compiler do?

3. Private Website - ASP Page to change user passwords

4. Mrgt not working with Options[_]: bits,growright

5. Change User Password via ADSI & ASP

6. CHI99: Call for Participation

7. Changing User Passwords with ADSI & ASP

8. IVSs TrumpCard on a A4000

9. ASP/ADSI change password in AD

10. Error changing password using ASP & ADSI

11. How can I slect a AD user whit in a asp page and ADSI

12. ADSI Search with ADO via an ASP Page

13. Can't access AD via LDAP & ADSI from ASP.NET (VB) page