• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2590
  • Last Modified:

LDAP://rootDSE in ASP?

can anyone explain why the following asp page doesn't work? It stops on line 9 saying  error (0x8007054B). line 9 is Set objDSE = GetObject("LDAP://rootDSE").

<%@ LANGUAGE="VBSCRIPT" %>

<form method="POST">
<select size="1" name="D1">

<%
Dim rstUsers
Dim objDSE, strNamingContext
Set objDSE = GetObject("LDAP://rootDSE")
strNamingContext = objDSE.Get("defaultNamingContext")
Set objDSE = Nothing
set rstUsers= CreateObject("ADODB.Recordset")
rstUsers.Open "SELECT sAMAccountName,physicalDeliveryOfficeName FROM 'LDAP://CN=Users," & strNamingContext  & "' WHERE objectClass='user' ORDER BY sAMAccountName", "Provider=ADsDSOObject"
While Not rstUsers.EOF
response.write "<option>" & rstUsers("sAMAccountName").Value & "</option>"
rstUsers.MoveNext
Wend
rstUsers.Close
Set rstUsers = Nothing
%>


</select>
</form>
0
tariqf
Asked:
tariqf
  • 2
  • 2
1 Solution
 
rhys_kirkCommented:
Looks like a permissions things that the IUSR_machinename account does not have priveleges to create the LDAP object.....
0
 
rhys_kirkCommented:
You will find that you can bind to

Set objDSE = GetObject("LDAP:")

not

Set objDSE = GetObject("LDAP://rootDSE")

0
 
Anthony PerkinsCommented:
Do you still need help with this question?
0
 
tariqfAuthor Commented:
acperkins I have jsut come back to this, and it still will not work! rhys_kirk's answer does not work! Please could you help me with this? I need your wisdom!
0
 
Anthony PerkinsCommented:
I am afraid not.  But now that I have your attention can you please maintain these very old open questions:

1 01/22/2004 210 sql statement replace string from row in...  Open Microsoft SQL Server
2 02/02/2003 90 remove duplicate rows with differing id'...  Open Mysql

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now