Skip to content

Get-ExchangeDistributionGroupReport

Exchange: Generates a detailed audit report of Distribution Groups

#Requires -Version 5.1

[CmdletBinding()]
Param ()

Process {
    try {
        $groups = Get-DistributionGroup -ErrorAction Stop

        $results = foreach ($g in $groups) {
            [PSCustomObject]@{
                Name                 = $g.Name
                DisplayName          = $g.DisplayName
                Alias                = $g.Alias
                GroupType            = $g.GroupType
                RecipientTypeDetails = $g.RecipientTypeDetails
                PrimarySmtpAddress   = $g.PrimarySmtpAddress
                ManagedBy            = $g.ManagedBy
                OrganizationalUnit   = $g.OrganizationalUnit
                DistinguishedName    = $g.DistinguishedName
                LastModified         = $g.WhenChanged
            }
        }

        Write-Output ($results | Sort-Object Name)
    }
    catch {
        throw
    }
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.