Let's say I have a forest setup with many domains. If I were to pick an arbitrary security group from any of the domains, what is the best way to find ALL user members of that group, including user members resulting from nested groups? I want to be able to do this regardless of the group type (i.e., Universal, Global, or Domain Local). My understanding is that we can't use the Global Catalog alone because group members are not replicated there for all group types.
We will ultimately do this with code but for now I just want to understand the process. For the sake of simplicity, let's say I already know the group's objectGUID value. Would the high-level steps be:
Query any global catalog in the forest for the group (via the objectGUID) and retrieve the domain in which the group is defined via its
objectCategory attributedistinguished nameQuery the domain controller in which the group is defined (retrieved in step 1) using the group's objectGUID and memberOf:1.2.840.113556.1.4.1941 as the filter
Is there anything else? Are there edge cases where I would have to query further domain controllers (e.g., further sub-domains)? Are there other cases where I wouldn't have to go further than the global catalog because the group type (or some other attribute) guarantees that all its member information is replicated in the global catalog?
EDIT
- Changed objectCategory to distinguished name