Error 0x80005000 and DirectoryServices

后端 未结 13 1964

I\'m trying to run a simple LDAP query using directory services in .Net.

    DirectoryEntry directoryEntry = new DirectoryEntry(\"LDAP://someserver.contoso.c         


        
13条回答
  •  佛祖请我去吃肉
    2020-11-29 04:57

    I had the same error - in my case it was extra slash in path argument that made the difference.

    BAD:

    DirectoryEntry directoryEntry = 
        new DirectoryEntry("LDAP://someserver.contoso.com/DC=contoso,DC=com/", 
                           userName, password);
    

    GOOD:

    DirectoryEntry directoryEntry = 
        new DirectoryEntry("LDAP://someserver.contoso.com/DC=contoso,DC=com", 
                           userName, password);
    

提交回复
热议问题