duckfather
Programmer
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
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