c# - Active Directory access using HostingEnvironment.Impersonate() fails to find the user -


i have looked @ every posting regarding reasons following exception:

an unhandled exception has occurred.  @ system.directoryservices.directoryentry.bind(boolean throwiffail) @ system.directoryservices.directoryentry.bind() @ system.directoryservices.directoryentry.get_adsobject() @ system.directoryservices.directorysearcher.findall(boolean findmorethanone) @ system.directoryservices.directorysearcher.findone() 

it appears best solution issue use hostingenvironment.impersonate() when calling directorysearcher suggested in many links including ones below: active directory com exception - operations error occurred (0x80072020) , getting error querying active directory on server only encapsulated code accessing directorysearcher in using (hostingenvironment.impersonate()) suggested , stopped getting exception cannot find user. way have seen further make in web.config file not fetching correct user, supposed windows user. need change in iis configuration? should mention similar other posts related subject, code works fine in local environment, i.e. running vstudio on own iis server. when deployed app , attempted run iis server. appreciated. thanks.

double check ldap path.

regarding com exception, switched "apppoolidentity" "networkservice", solved issue.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -