Editor: Script to enumerate the members of groups in the domain.
This is an example of how you can look up all the members of a group in AD. It will also look up the membership of any sub-groups it finds.
It will also use the groups primary group token and find all users that have that group set as their primary group. This is necessary as AD uses the primaryGroupID to calculate a group's membership.