DirectoryServicesCOMException (0x80072030) when trying to access active directory

1

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.

c#
active-directory
ldap
asked on Stack Overflow Sep 16, 2015 by Yaroslav Yakovlev • edited May 23, 2017 by Community

1 Answer

1

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.

answered on Stack Overflow Sep 17, 2015 by Yaroslav Yakovlev

User contributions licensed under CC BY-SA 3.0