?
Solved

ASP and LDAP

Posted on 2003-03-13
6
Medium Priority
?
868 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:Noodles22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 8133409
0
 
LVL 1

Author Comment

by:Noodles22
ID: 8133583
thanks, but i tried that, and still got the same error message
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 8133855
Tried what?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Accepted Solution

by:
lavinder earned 160 total points
ID: 8133999
hi

 try using WinNT provider

 Dim usr
 Set usr = GetObject("WinNT://domain/username,user")
 usr.ChangePassword "guesswhat?", "topsecret98"

 in ldap, i think the following string is incorrect
set objUser = GetObject("LDAP://ldap.nzan.co.nz/" & objSysInfo.UserName)
 
 try this
 set objUser=GetObject("LDAP://cn=" & objSysInfo.UserName & ",dc=nzan,dc=co,dc=nz")

0
 
LVL 7

Expert Comment

by:lavinder
ID: 8134018
in ldap, i mean to say that you need to get/specify the ADsPath of user.

0
 
LVL 58

Expert Comment

by:Gary
ID: 9350084
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
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question