April 7, 2014
This will give you all Distribution Groups on the server. If you want to only get one DG, use -Identity *DG NAME* on the first line of the script.
$Groups=Get-DistributionGroup $Groups| foreach { $GroupName=$_.Name $Report+=Get-distributionGroupMember -identity $_.identity| select @{Name='Distribution Group'; Expression={[String]::join(";", $GroupName)}}, Name, PrimarySmtpAddress} $Report| export-csv ".\DGMembers.csv" -notype
Source: http://bit.ly/1g1Oeuz
Comments
Latest posts in the same category
April 3, 2014
I have a pretty large virtual environment at work to the tune of 1600 VMs, 19 hosts, 5 clusters, 46 networks, and 67 datastores. In . . .
December 5, 2013
Have you ever been asked to give someone permission to view someone else’s calendar? I generally have them speak directly with whomever’s calendar they wish . . .