Create a spreadsheet showing members of a distribution group
A simple Exchange Management Shell (EMS) command to create a spreadsheet showing members of a distribution group.
I have tried this using Active Directory shell as well but found the Exchange Management Shell worked out much better. Here is the command:
get-distributiongroup -identity "yourdistributiongroupname" | get-distributiongroupmember | select-object displayname,primarysmtpaddress,title
This particular command outputs three columns for us. In addition to the users name I needed to output each users email address and their job title, obviously those items can be omitted or others added as you require. As we need to provide a spreadsheet to whoever requested it we output it as a CSV, then we can open it in Excel and save it as an Excel spreadsheet.