|
Prev: Out of string space
Next: Simple File Upload Script
From: Enigma Webmaster on 16 Feb 2005 13:52 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 ------------------------------------
From: Curt_C [MVP] on 16 Feb 2005 16:03 try, just as a test, using a Domain Admin as the IIS user. -- Curt Christianson Site & Scripts: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com "Enigma Webmaster" <info(a)enigma-one.com> wrote in message news:nDMQd.2419$74.784(a)newsfe1-win.ntli.net... > 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 ------------------------------------ > >
|
Pages: 1 Prev: Out of string space Next: Simple File Upload Script |