Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LDAP://rootDSE in ASP?

Posted on 2003-12-11
5
Medium Priority
?
2,348 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 160 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

Industry Leaders: 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 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…
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/…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 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