Skip to content

Get-ExchangeAddressList

Exchange: Lists all Address Lists in the Exchange organization

#Requires -Version 5.1

[CmdletBinding()]
Param (
    [string]$Filter
)

Process {
    try {
        $params = @{
            'ErrorAction' = 'Stop'
        }
        if ($Filter) { $params.Add('Filter', $Filter) }

        $addressLists = Get-AddressList @params

        $results = foreach ($al in $addressLists) {
            [PSCustomObject]@{
                Name           = $al.Name
                DisplayName    = $al.DisplayName
                Path           = $al.Path
                IsValid        = $al.IsValid
                LastModified   = $al.WhenChanged
            }
        }

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

Specifies an optional filter to apply to the Address List retrieval.

An interactive directory of PowerShell scripts.