Sometimes the architecture in active directory is very complicated. There are many groups in my AD and they are hierarchical.
Take this for example:
Group A is the top group, it has a child Group B, and Group B also has a child C. C is the leaf node and it is a person in AD. Is there an approach to identify C is a member of Group A.
I can do this by enumerating the “memberof” property recursively in AD. But is there a more efficient mechanism to do that work?
I need to do that in .NET with C#. Any help will be appreciated.
Check out UserPrincipal.GetAuthorizationGroups. It’s giving you all the groups in the token, as mentioned by Swanny