ASP & LDAP

E

Enigma Webmaster

We've had an ASP running for about 9 months which returns a full listing of
network users (taken directly from AD), and it has now stopped working with
the following;

Provider Error '80004005'.

If I remove a field called 'userAccountControl' from the field list it works
to a certain extent but still fails further down the code with not finding
content ofr the field called 'Name'. I think its very probably a
permissions error, can someone point out the obvious to me please ???

Regards & thanks in anticipation..

KP

' ------------------------ Create Connection to Active
Directory -----------------------------------------
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Provider = "ADsDSOObject"
strConn = "ADs Provider"
objConn.Open strConn

' ------------------------ Create Active Directory SQL Query
String --------------------------------------
if request.querystring("order")="" then
strQuery = "SELECT name, mail, telephonenumber, homephone, mobile,
postalcode, st, title, info, userAccountControl"
strQuery = strquery & "distinguishedName FROM 'LDAP://domain.com' WHERE
objectcategory='user' and "
strQuery = strquery & " objectClass = 'user' AND msExchHomeServerName =
'*cn=ATVMAILSVR' AND name <> 'SystemMailbox*' "
strQuery = strquery & " AND OU <> 'User' AND NOT
msExchhidefromAddresslists=TRUE order by name"
else
strQuery = "SELECT name, mail, telephonenumber, homephone, mobile,
postalcode, st, title, info,"
strQuery = strquery & "distinguishedName FROM 'LDAP://domain.comWHERE
objectcategory='person' and "
strQuery = strquery & " objectClass = 'user' AND msExchHomeServerName =
'*cn=ATVMAILSVR' AND name <> 'SystemMailbox*' "
strQuery = strquery & " AND OU <> 'User' AND NOT
msExchhidefromAddresslists=TRUE order by " & request.querystring("order")
end if

' ------------------------ Open Recordset & populate various
counters ------------------------------------
objRS.Open strQuery, objConn, 1, 1
intRowCount = objrs.recordcount
objrs.MoveFirst
' ------------------------ loop through recordset and display
details ------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top