Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP ASP Query Fails on W2003 with Error 80004005

Status
Not open for further replies.

duckfather

Programmer
Feb 22, 2005
2
GB
Hi

I have some code that queries AD on a mixed W2K and W2003 environment :-

strLogonUser=request.servervariables("LOGON_USER")
strRootUserOU="MyUsersOU"

strRS = "SELECT displayname, mail, telephonenumber, samAccountName, description, distinguishedName, " &_
"cn FROM 'LDAP://domain.com/OU=" & strRootUserOU &_
",DC=domain,DC=com' WHERE objectClass='user' AND " &_
"objectCategory='person' AND description <> 'CiscoPrivateUser' AND " &_
"samAccountName='" & strLogonUser & "'"

Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
Conn.Provider = "ADsDSOObject"
strConn = "Active Directory Provider"
Conn.Open strConn

RS.Open strRS, Conn, 1, 1 <==Error occurs here

The above code retrieves the requested data fine on W2K IIS, but fails with 'Unexpected Error 80004005' on W2003 IIS.

I've read many postings suggesting that I need to give my 'IUSR_SERVERNAME' account read privelages to AD, but I'm not using Anonymous logons. I'm using Integrated Windows Authentication, as I only want authenticated domain members to access my webpage (this is also the only way I can be certain of the users Logon Name so that I can automatically retrieve this users data from AD).

Has anyone any ideas?

Thanks in advance.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top