Distribution Groups nested – get list only groups

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"}

 

Print Friendly
Tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>