?
Solved

ASP and LDAP

Posted on 2003-03-13
6
Medium Priority
?
875 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
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Suggested Courses

616 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