Solved

LDAP://rootDSE in ASP?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

18 Experts available now in Live!

Get 1:1 Help Now