I need to get a list of all of the users who are ultimately members of an active directory group. There's a single parent group which has a few other groups as its members, and each of those groups have a few users and several other groups as members in turn.
I need to extract:
- First Name
- Last Name
- AD Username
From every user who is a member (directly or indirectly) of the top level group. It feels like this should be possible with dsquery, but I've only limited experience and can't figure out the syntax. It also should be possible using a DirectorySearcher in the System.DirectoryServices .Net namespace, but my LDAP isn't quite good enough!
Any suggestions on how to proceed with either approach would be much-appreciated.