Solved

LDAP://rootDSE in ASP?

Posted on 2003-12-11
5
2,288 Views
Last Modified: 2007-12-19
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
Comment
Question by:tariqf
[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
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:rhys_kirk
ID: 9921238
Looks like a permissions things that the IUSR_machinename account does not have priveleges to create the LDAP object.....
0
 
LVL 2

Accepted Solution

by:
rhys_kirk earned 40 total points
ID: 9921276
You will find that you can bind to

Set objDSE = GetObject("LDAP:")

not

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

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10504839
Do you still need help with this question?
0
 
LVL 1

Author Comment

by:tariqf
ID: 11380428
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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11380505
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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