Solved

LDAP://rootDSE in ASP?

Posted on 2003-12-11
5
2,160 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now