Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone allow password changes on their intranet???

Status
Not open for further replies.

sw1llam3

IS-IT--Management
Aug 28, 2002
9
US
To anyone who may be able to help....
This is actually simple code and should work, but I am not an ASP pro and can't figure out why this isn't working for me.

This is what I am trying to implement...

Referring to an article "Changing Passwords", in the January 2001 issue of Windows 2000 Magazine, the author Ken Spencer's ASP code would definitely help my networks functionallity in a big way.

I have made it work with Windows NT 4.0. However, I am getting errors on line 23 when trying to implement the sConnectString line using the LDAP code. I tested the code by inserting a Response. Write after the LDAP code and the information seems to be passing correctly. When I attempt to execute the script through the Microsoft Explorer I get the following error code...

LDAP://CN=ssgas, OU=users, DC=spgrp, DC=net
error '8007054b'
/ChangePassword1.asp, line 23


The error code reveals a "cannot connect to domain" response. If I am passing through the proper LDAP code, I don't see why I am not connecting to the domain.I have posted the code below...


Any help with this would be greatly appreciated.


Thank you,


Tony

The first ASP page 'ChangePasswordEntry' is listed here...

Language=VBScript %>

<%
dim sUser, sPassword
dim oUser, sConnectString


sUser = request(&quot;txtUserName&quot;)
sPassword = request(&quot;txtPassword&quot;)
sNewPassword = request(&quot;txtNewPassword&quot;)
sConfPassword = request(&quot;txtConfPassword&quot;)

if sUser = &quot;&quot; then Response.Redirect &quot;ChangePasswordEntry.asp&quot;

if sNewPassword <> sConfPassword then Response.Redirect &quot;BadPassword.htm&quot;

sConnectString = &quot;LDAP://CN=&quot; & sUser & &quot;, OU=users, &quot; & &quot;DC=spgrp, DC=net&quot;

Response.Write sConnectString

Response.Write &quot;<br>&quot;

Set oUser = GetObject(sConnectString)

oUser.ChangePassword sPassword, sNewPassword

Response.Write &quot;<Title> Password Changed </Title>&quot;

Response.Write &quot;<H3> &quot; & sUser & &quot;: Your password has been changed </H3> <br> <br>&quot;

Response.Write &quot;<p> Please click <a href= to return to main remote access page.</p>&quot;


set oUser = Nothing


%>

The second ASP page which is posted to by the first is this...


Language=VBScript %>

<%
dim sUser, sPassword
dim oUser, sConnectString


sUser = request(&quot;txtUserName&quot;)
sPassword = request(&quot;txtPassword&quot;)
sNewPassword = request(&quot;txtNewPassword&quot;)
sConfPassword = request(&quot;txtConfPassword&quot;)

if sUser = &quot;&quot; then Response.Redirect &quot;ChangePasswordEntry.asp&quot;

if sNewPassword <> sConfPassword then Response.Redirect &quot;BadPassword.htm&quot;

sConnectString = &quot;LDAP://CN=&quot; & sUser & &quot;, OU=users, &quot; & &quot;DC=spgrp, DC=net&quot;

Response.Write sConnectString

Response.Write &quot;<br>&quot;

Set oUser = GetObject(sConnectString)

oUser.ChangePassword sPassword, sNewPassword

Response.Write &quot;<Title> Password Changed </Title>&quot;

Response.Write &quot;<H3> &quot; & sUser & &quot;: Your password has been changed </H3> <br> <br>&quot;

Response.Write &quot;<p> Please click <a href= to return to main remote access page.</p>&quot;


set oUser = Nothing


%>
 
Looks like you need to specify the name of the server running LDAP, IE LDAP://myExchangeServer/CN=ssgas, OU=users, DC=spgrp, DC=net

I'm no LDAP pro, but that's what it looks like to me. You can cut n paste the line into the address bar of your browser and try to connect directly, then once you get that working, use the same syntax in your password app.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top