Os grupos de distribuição são armazenados no Active Directory. Este script Powershell listará todos os grupos de distribuição no domínio do AD e seus membros. Se você as tiver armazenado como grupos de segurança, remova "(| (groupType = 2) (groupType = 4) (groupType = 8))".
$strFilter = "(&(objectCategory=Group)(|(groupType=2)(groupType=4)(groupType=8)))"
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = "Subtree"
$objSearcher.PropertiesToLoad.Add("cn") | Out-Null
$objSearcher.PropertiesToLoad.Add("member") | Out-Null
$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults){
$objItem = $objResult.Properties;
Write-Output $objItem.cn
foreach ($objMember in $objItem.member) {
Write-Output " $objMember"
}
}