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.
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"
If Not rs.EOF Then
Set rs = Nothing
Set conn = Nothing
Set oRoot = Nothing
Set oDomain = Nothing
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.