This post is also available in: Polish
Recently, we described how to obtain a list of all mailboxes in the group that has nested distribution groups.
Unfortunately, using this method, you can not get a list of groups in a distribution group, only users (mailboxes).
To obtain this list, you need to write more or less complicated powershell script or use the additive Quest Powershell Module for Active Directory.
After installation of Quest Module, run powershell console and run:
add-PSSnapin quest.activeroles.admanagement
From this point, we have access to many very interesting commands to facilitate the work of the Active Directory using powershell.
For our case we use the command Get-QADGroupMember as following:
Get-QADGroupMember "Test_Group" -indirect | where {$_.type -eq "group"}
In this case, to find objects that are nested we use -Indirect instead of the -Recursive parameter.
The result of this query will list the groups directly or indirectly attributable to the group Test_Group
If you are interested only distribution groups, a list can be a very easy way to get the following command:
Get-QADGroupMember "master DL" -indirect | where {$_.type -eq "group" -and $_.grouptype -like "Distribution"}