Exchange 2007 Quick Tip: Getting Members of a Dynamic Distribution Group

If you need to get a listing of all the people (and email addresses) who will receive an email from a dynamic distribution group and then export that to CSV:

$members = Get-DynamicDistributionGroup -resultsize unlimited -Identity “Distribution Group Name”
Get-Recipient -resultsize unlimited -RecipientPreviewFilter $members.RecipientFilter | select Displayname,PrimarySmtpAddress | Export-Csv C:\temp\NameOfCSV.Csv