Answer: To get all the users that are members of a specific distribution group on Exchange Server we will use the get-distributiongroupmember cmdlet.
The following cmdlet will display all the users that are members of a distribution group:
Get-DistributionGroupMember -resultsize 3000 Nameoflist| Get-Mailbox |Format-Table name, PrimarySmtpAddress
If you need to export the list to a text file just pipe the output to a text file like this:
Get-DistributionGroupMember Nameoflist| Get-Mailbox |Format-Table name, PrimarySmtpAddress c:\members.txt