Dump all Distribution Groups -Exchange Server Powershell

Getting the members of each distribution group into a CSV file on an exchange server is easy using powershell.

This will create one CSV file per group.

$dg=get-distributiongroup

foreach ( $g in $dg ) {
    Get-DistributionGroupMember $g.Name
    $fn="C:\scripts\distgroup_$($g.name).csv"
    $fn
    Get-DistributionGroupMember $g.Name | export-csv -Path $fn 

    }
    

About Jeff Turner

Technical director of Nano Tera Network Solutions.
This entry was posted in Powershell, VBS, VBA and other scripting., System Administration. Bookmark the permalink.