开发者

Unknown error (0x5011) with ActiveDirectory PrincipalContext

开发者 https://www.devze.com 2023-02-03 07:35 出处:网络
I am trying to get the UserGroups that the user belongs to from MVC application using PrinicipalContect object.

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() 


http://support.microsoft.com/kb/969166

0

精彩评论

暂无评论...
验证码 换一张
取 消