May I know what is the ldap query string to get list of all the Domain Admins? I found that Active Directory has a group called Domain Admin when AD is installed. So, I can query to get all the members of this group. But, I have to provide the DN for this group like CN=Domain Admins,CN=Users,DC=bar,DC=foo,DC=com. It gets complicated in case of multiple domains as I have to create the query string for each domain.
Is there a better way to do this? What is the query that I have to run to get all the sub domains?
Query from your forest root with:
memberOf
: DN of the group which is domain admin. If there is no forest-wide group, perform the step per group in a loop.