troubleshooting Question

0x80072020 error when trying to access the Active Directory using LDAP within ASP

Avatar of I-eye
I-eye asked on
Windows Server 2003
8 Comments2 Solutions10575 ViewsLast Modified:
Hi Experts,

I'm creating a script that queries the AD to find all our employees and f.e. their phonenumbers. The script works fine locally on my Win2000 machine. When another user tries the open the page he/she gets the 0x80072020 error on the line 7 (marked in the code). In the IIS properties IWA has been selected as authentication method.

[code]
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

Set oRoot = GetObject("LDAP://rootDSE")
sDomain = oRoot.Get("defaultNamingContext")
Set oDomain = GetObject("LDAP://" & sDomain) <------ the line that results in an error

sBase = "<" & oDomain.ADsPath & ">"
sFilter = "(&(objectCategory=person)(objectClass=user)(description=*)(!description=Mailbox)(sn=*)(!Description=Built*))"
sAttribs = "adsPath"
sDepth = "subTree"

sQuery = sBase & ";" & sFilter & ";" & sAttribs & ";" & sDepth

conn.Provider = "ADsDSOObject"
                   
conn.Open "Data Source=Active Directory Provider"
 
rs.Open conn.Execute(sQuery)

If Not rs.EOF Then
   'do stuff
End If

rs.Close

Set rs = Nothing
Set conn = Nothing
Set oRoot = Nothing
Set oDomain = Nothing
[/code]
Using google I found out that this most likely has something to do with access-rights within the Active Directory, but I can't seem to find the correct answer how to solve this. Could someone explain to me what rights (policy?) need to be added to all the users so that they can query our AD using the ASP page?

I've posted this question in the OS/W2k3 selection, because I suspect the solution lies here and not within the ASP-page I've created.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros