-->

Wednesday, March 9, 2016

Exchange 2013 Export Distribution Group Owners Report To CSV

I recently had a request to export the owners of a bunch of distribution groups so one of our Business Unit's managers could review them and see who should or shouldn't be group owners.

Pulling such a report is easy with PowerShell!

We have our distro groups for each Business Unit separated in OU's, so I'm including that part in the cmdlet.

Fire up the Exchange Management Shell (EMS) and run:

Get-DistributionGroup -OrganizationalUnit "domain.com/Distribution Lists/Business Unit" | Select-object Name,@{label="ManagedBy";expression={[string]($_.managedby | foreach {$_.tostring().split("/")[-1]})}},Primarysmtpaddress | Export-Csv "C:\BU_Dist_Owners.csv"

**Note** Change "domain.com/Distribution Lists/Business Unit" to the OU you're running it against, and change "C:\BU_Dist_Owners.csv" to the name and path of your choosing.

You'll get a nice report with the Group Name, Owner, and Primary SMTP Address.

To run a report for all Distribution Groups in your environment, just leave out the -OrganizationalUnit part, like so:

Get-DistributionGroup | Select-object Name,@{label="ManagedBy";expression={[string]($_.managedby | foreach {$_.tostring().split("/")[-1]})}},Primarysmtpaddress | Export-Csv "C:\All_Dist_Owners.csv"

**Note** Again, change "C:\All_Dist_Owners.csv" to your path.

Happy reporting!

1 comment: