$File = “C:\ita\groupslog.txt”
$Mailboxes = Get-DistributionGroup | select name , alias ,displayname,EmailAddresses
$Mailboxes | ForEach {
echo “”
echo “”
echo $_.name
Get-DistributionGroupMember -id $_.alias
} | out-File $File

By admin

Leave a Reply

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