active directory - How to get the cross forest membership of the user in C#? -


i have 2 trust forest , b, user c belong forest , group d belong forest b. assign user c group d.

my question is, want membership of user c. know how in c#?

i have tried .net api, membership of current domain user. know "member" property store membership, need search groups in trust forest , check "member" property achieve this?

the test program below tried trust forest membership. domain "a.com" forest , domain "b.com" forest b.

using (principalcontext ctx = new principalcontext(contexttype.domain, "a.com")) {     using (principalcontext ctx2 = new principalcontext(contexttype.domain, "b.com"))     {         userprincipal user = userprincipal.findbyidentity(ctx, "c");         var groups1 = user.getgroups(ctx); // memebership of a.com         var groups2 = user.getgroups(ctx2); // cannot membership of b.com     } } 

thanks.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -