|
| |||||||||
| Tags: 80072020, asp, ldap, query |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 80072020 Error in ASP LDAP Query
Hi, I've this ASP code for query in LDAP. It works fine as vbscript, but in IIS 6.0 doesn't work with error 80072020 on line ... GetObject("LDAP://" & strDomainDN)... In IIS I've only checked "Integrated Windows Authentication"... IIS Server in a standalone server 2003 joined to the smmi.it domain Thanks a lot in advance! ************* Function UsrLDAPinfo(userlogin,varuser) Dim objRootDSE Dim objConnection Dim strDomainDN set objRootDSE = GetObject("LDAP://smmi.it/RootDSE") Set objConnection = CreateObject("ADODB.Connection") objConnection.Provider = "ADsDSOObject" objConnection.Open "Data Source=Active Directory Provider;Provider=ADsDSOObject" strDomainDN = objRootDSE.Get("defaultNamingContext") Set oDomain = GetObject("LDAP://" & strDomainDN) sBase = "<" & oDomain.ADsPath & ">" sFilter = "(&(objectCategory=person)(objectClass=user)(name=" & userlogin & "))" sAttribs = "adspath" sDepth = "subTree" sQuery = sBase & ";" & sFilter & ";" & sAttribs & ";" & sDepth Set rs = objConnection.Execute(sQuery) Set user = GetObject(rs("adsPath")) if Ucase(varuser)=Ucase("cn") then UsrLDAPinfo=user.cn elseif (varuser)=Ucase("firstname") then UsrLDAPinfo=user.Firstname elseif Ucase(varuser)=Ucase("lastname") then UsrLDAPinfo=user.lastname elseif Ucase(varuser)=Ucase("telephonenumber") then UsrLDAPinfo=user.telephonenumber elseif Ucase(varuser)=Ucase("displayname") then UsrLDAPinfo=user.displayname elseif Ucase(varuser)=Ucase("EmailAddress") then UsrLDAPinfo=user.EmailAddress elseif Ucase(varuser)=Ucase("description") then UsrLDAPinfo=user.description end if rs.Close objConnection.Close End Function ********************* |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "80072020 Error in ASP LDAP Query" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LDAP Query AD | Active Directory | 7 | 03-06-2010 12:23 PM | |
| LDAP query to speficied LDAP server on TCP port 389 failed | Shash | Windows Server Help | 1 | 29-05-2009 10:46 PM |
| LDAP query can it be done ? | zscw1 | Active Directory | 4 | 13-11-2008 10:08 AM |
| LDAP Query | Anzelem | Window 2000 Help | 3 | 07-02-2008 10:23 PM |
| LDAP Search Query Error | jeff | Active Directory | 4 | 19-03-2006 05:15 AM |