Yaroslav Yakovlev
Yaroslav Yakovlev

Reputation: 6483

DirectoryServicesCOMException (0x80072030) when trying to access active directory

I'm trying to access AD data via ldap with the connection like: LDAP://dc1.corp:port/OU=Users,DC=domain,DC=com

Then using the directorySearcher.FindOne().GetDirectoryEntry(); This 100% works on my machine, but when I do this on the server it throws DirectoryServicesCOMException (0x80072030) There is no such object on the server.

I found the similar question on so, but it doesn't help. Currently I'm looking for the way to at least understand why there is a difference for ldap access on my local PC and on the server.

Upvotes: 1

Views: 1998

Answers (1)

Yaroslav Yakovlev
Yaroslav Yakovlev

Reputation: 6483

For me the problem was in permissions under which the application pool was running. What I did to investigate was 1 console app and 1 web app. And I noticed, that when I ran the console app it got the data from AD immediately. And web app always throw that COM exception. I'm not 100% sure what exact permissions are needed to give web app the access to the AD( I dont know the exact difference between the local system account and my domain user account that matters) but hope this will help someone to solve the similar problem.

Upvotes: 1

Related Questions