“A referral was returned from the server” exception when accessing AD from C#

后端 未结 8 1418
不知归路
不知归路 2020-12-01 18:08
DirectoryEntry oDE = new DirectoryEntry(\"LDAP://DC=Test1,DC=Test2,DC=gov,DC=lk\");

using (DirectorySearcher ds = new DirectorySearcher(oDE))
{
    ds.PropertiesToL         


        
8条回答
  •  庸人自扰
    2020-12-01 18:44

    Had the same issue and managed to resolve it.

    In my case, I had an AD group in the current logon domain with members (users) from a sub domain. The server that I was running the code on could not access the domain controller of the sub domain (the server had never needed to access the sub domain before).

    I struggled for a while as my desktop PC could access the domain so everything looked OK in the MMC plugin (Active Directory Users & Computers).

    Hope that helps someone else.

提交回复
热议问题