简体   繁体   中英

Unknown error (0x5011) with ActiveDirectory PrincipalContext

I am trying to get the UserGroups that the user belongs to from MVC application using PrinicipalContect object.

Here is the Code Reference from: http://anyrest.wordpress.com/2010/06/28/active-directory-c/

For my userID (DOMAIN A), I am able to retrieve all the Groups that i belong to. Now I tried to get the Groups of UserB who is under DOMAIN A. This also worked fine.

Now i am trying to get the Groups of UserC who is under a different Domain DOMAIN B.

It is throwing an error as below. Anyone has any idea about this.

    **System.Runtime.InteropServices.COMException:**
    Unknown error (0x5011).

    **ERROR CODE:** 
    20497    

    **Message:**
    Unknown error (0x5011).

    **StackTrace:** 
    at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext()
       at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.GetNextSearchResult()
       at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNextMemberSearcher()
       at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNext()
       at System.DirectoryServices.AccountManagement.ADDNConstraintLinkedAttrSet.MoveNext()
       at System.DirectoryServices.AccountManagement.FindResultEnumerator`1.MoveNext() 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM