Link to home
Start Free TrialLog in
Avatar of Noodles22
Noodles22

asked on

ASP and LDAP

Hi,

I'm trying to use this code to set a users ldap password via an ASP page

<%@ Language=VBScript %>
<%

'On Error Resume Next
if(request.form("currpass") <> "" AND request.form("newpass1") <> "" AND request.form("newpass2") <> "" AND request.form("newpass1") = request.form("newpass2")) Then
strOldPassword = request.form("currpass")
strNewPassword = request.form("newpass1")

set objSysInfo = CreateObject("ADSystemInfo")
response.write objSysInfo.UserName
set objUser = GetObject("LDAP://ldap.nzan.co.nz/" & objSysInfo.UserName)
objUser.ChangePassword strOldPassword,strNewPassword
     if(Err.Number <> 0) Then
%>
     <script>
          self.location='<% response.write replace(Request.ServerVariables("HTTP_REFERER"),"&wrongpass=true","") %>&wrongpass=true';
     </script>
<%
     end if
objUser.SetInfo
if(Err.Number = 0) Then %>
     <script>
          self.location='<% response.write replace(Request.ServerVariables("HTTP_REFERER"),"&wrongpass=true","") %>&passchanged=true';
     </script>
<%
end if
end if
%>

I works on our development server, but when we deploy to our client's server we get this error:

Active Directory error '8000500c'

The Active Directory datatype cannot be converted to/from a native DS datatype

/nzan_intranet/changepassword.asp, line 13


Can anyone help?

Thanks
Avatar of Mark Franz
Mark Franz
Flag of United States of America image

Avatar of Noodles22
Noodles22

ASKER

thanks, but i tried that, and still got the same error message
Tried what?
ASKER CERTIFIED SOLUTION
Avatar of lavinder
lavinder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in ldap, i mean to say that you need to get/specify the ADsPath of user.

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by lavinder

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer