Skip to content

Get-ExchangeActiveSyncPolicy

Exchange: Lists all ActiveSync Mailbox Policies

#Requires -Version 5.1

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

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

        $policies = Get-ActiveSyncMailboxPolicy @params

        $results = foreach ($p in $policies) {
            [PSCustomObject]@{
                Name                        = $p.Name
                IsDefault                   = $p.IsDefault
                AllowNonProvisionableDevices = $p.AllowNonProvisionableDevices
                DevicePasswordEnabled       = $p.DevicePasswordEnabled
                AlphanumericDevicePasswordRequired = $p.AlphanumericDevicePasswordRequired
                DistinguishedName           = $p.DistinguishedName
                LastModified                = $p.WhenChanged
            }
        }

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

Optional. Specifies the Identity of a specific policy to retrieve.

An interactive directory of PowerShell scripts.