|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
LDAP Script works in Vbscript, not in IIS Web Page
I am trying to connect via LDAP to AD. I’m using Getobject("LDAP://RootDSE") from an ASP page on the IIS Dev box. The error I keep getting is 8007054b, which translates into "The specified domain either does not exist or could not be contacted."
I can run the same code in a vbs script and have no errors and return the data I want. I can run that script locally, server side or even from inetwww on the dev box. As soon as the code is ensconced in a web page, it fails. I found a post on ASP Free with the same problem, entitled “8007054b error accessing RootDSE from asp” where members SerialHobbyinst and Doug G, et al, discuss the problem and provide a solution involving going “into active directory users and computers and mark the server that is serving those pages as "Trust this computer for delegation" on the general tab then on the IIS website you go into properties and edit directory security so that no anonymous access is granted and select windows authentication and then it will be the user logged on to the computer that gets authenticated to AD when querying LDAP”, I can’t make the change suggested in my environment. However, myobj = GetObject(“LDAP:”) is successful. Can someone help with this? Here is what I'm thinking: 1. After myobj = GetObject(“LDAP:”) is successful, and I query ‘LDAP://dc=DCone,Dc=DCtwo’, the new error message says, "Table not found". I assume it’s because I having provided the full path – but is there another reason? 2. Of course, strMyDNS=Get.myobj(“DefaultNamingContext”) fails. Is there an alternative property? 3. How do I obtain the full path since I do not have the RootDSE object? I’ve tried ‘LDAP://CN=Schema,CN=Configuration, DC=DCone, DC=DCtwo’ and ‘LDAP://CN=CN=Aggregate, CN=Schema,CN=Configuration, DC=DCone, DC=DCtwo’ 4. Is there another way you might suggest to get the queries to work? Thanks for your help. |
|
#2
|
||||
|
||||
|
Quote:
Why not? |
|
#3
|
|||
|
|||
|
This script works for me in Classic ASP Vbscript to authentication in LDAP - iPlanet
struser= "your_user"
strpwd= "your_user_pwd" strdomain= "your_domain.com" strvaliddn= "uid=" & struser & ",ou=People,o=" & strdomain & ",o=isp" strservername="your_server_name_or_ip:389" Set conn = CreateObject("ADODB.Connection") conn.Provider = "ADsDSOObject" conn.Properties("User ID") = struser conn.Properties("Password") = strpwd conn.Open "ADs Provider", strvaliddn, strpwd Set objldap = CreateObject("ADODB.Command") objldap.ActiveConnection = conn on error resume next objldap.CommandText = "SELECT cn FROM 'LDAP://" & strservername & "/" & strvaliddn & "' " set rs = objldap.Execute If rs.eof or rs.bof then authresult="" else authresult="Y" end if set objldap=nothing set rs=nothing Set conn=nothing |
![]() |
| Viewing: ASP Free Forums > System Administration > Microsoft IIS > LDAP Script works in Vbscript, not in IIS Web Page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|