Commands › Exchange Online

New-EmailAddressPolicy

Exchange Online ExchangeOnlineManagement New-*

Create email address policies. In Exchange Online, email address policies are available only for Microsoft 365 Groups.

Quick start script

# New-EmailAddressPolicy — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-EmailAddressPolicy
$before | Format-List

# 3. Make the change (dry run first)
New-EmailAddressPolicy -Name <String> -EnabledEmailAddressTemplates <ProxyAddressTemplateCollection> -EnabledPrimarySMTPAddressTemplate <String> -WhatIf
New-EmailAddressPolicy -Name <String> -EnabledEmailAddressTemplates <ProxyAddressTemplateCollection> -EnabledPrimarySMTPAddressTemplate <String>

# 4. Verify and diff
$after = Get-EmailAddressPolicy
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 6 parameter sets

AllTemplatesWithPrecannedFilter

New-EmailAddressPolicy [-Name] <String> -EnabledEmailAddressTemplates <ProxyAddressTemplateCollection> -IncludedRecipients <WellKnownRecipientType>
 [-ConditionalCompany <MultiValuedProperty>]
 [-ConditionalCustomAttribute1 <MultiValuedProperty>]
 [-ConditionalCustomAttribute10 <MultiValuedProperty>]
 [-ConditionalCustomAttribute11 <MultiValuedProperty>]
 [-ConditionalCustomAttribute12 <MultiValuedProperty>]
 [-ConditionalCustomAttribute13 <MultiValuedProperty>]
 [-ConditionalCustomAttribute14 <MultiValuedProperty>]
 [-ConditionalCustomAttribute15 <MultiValuedProperty>]
 [-ConditionalCustomAttribute2 <MultiValuedProperty>]
 [-ConditionalCustomAttribute3 <MultiValuedProperty>]
 [-ConditionalCustomAttribute4 <MultiValuedProperty>]
 [-ConditionalCustomAttribute5 <MultiValuedProperty>]
 [-ConditionalCustomAttribute6 <MultiValuedProperty>]
 [-ConditionalCustomAttribute7 <MultiValuedProperty>]
 [-ConditionalCustomAttribute8 <MultiValuedProperty>]
 [-ConditionalCustomAttribute9 <MultiValuedProperty>]
 [-ConditionalDepartment <MultiValuedProperty>]
 [-ConditionalStateOrProvince <MultiValuedProperty>]
 [-Confirm]
 [-DisabledEmailAddressTemplates <ProxyAddressTemplateCollection>]
 [-DomainController <Fqdn>]
 [-Priority <EmailAddressPolicyPriority>]
 [-RecipientContainer <OrganizationalUnitIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

AllTemplatesWithCustomFilter

New-EmailAddressPolicy [-Name] <String> -EnabledEmailAddressTemplates <ProxyAddressTemplateCollection> -RecipientFilter <String>
 [-Confirm]
 [-DisabledEmailAddressTemplates <ProxyAddressTemplateCollection>]
 [-DomainController <Fqdn>]
 [-Priority <EmailAddressPolicyPriority>]
 [-RecipientContainer <OrganizationalUnitIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

SMTPTemplateWithPrecannedFilter

New-EmailAddressPolicy [-Name] <String> -EnabledPrimarySMTPAddressTemplate <String> -IncludedRecipients <WellKnownRecipientType>
 [-ConditionalCompany <MultiValuedProperty>]
 [-ConditionalCustomAttribute1 <MultiValuedProperty>]
 [-ConditionalCustomAttribute10 <MultiValuedProperty>]
 [-ConditionalCustomAttribute11 <MultiValuedProperty>]
 [-ConditionalCustomAttribute12 <MultiValuedProperty>]
 [-ConditionalCustomAttribute13 <MultiValuedProperty>]
 [-ConditionalCustomAttribute14 <MultiValuedProperty>]
 [-ConditionalCustomAttribute15 <MultiValuedProperty>]
 [-ConditionalCustomAttribute2 <MultiValuedProperty>]
 [-ConditionalCustomAttribute3 <MultiValuedProperty>]
 [-ConditionalCustomAttribute4 <MultiValuedProperty>]
 [-ConditionalCustomAttribute5 <MultiValuedProperty>]
 [-ConditionalCustomAttribute6 <MultiValuedProperty>]
 [-ConditionalCustomAttribute7 <MultiValuedProperty>]
 [-ConditionalCustomAttribute8 <MultiValuedProperty>]
 [-ConditionalCustomAttribute9 <MultiValuedProperty>]
 [-ConditionalDepartment <MultiValuedProperty>]
 [-ConditionalStateOrProvince <MultiValuedProperty>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Priority <EmailAddressPolicyPriority>]
 [-RecipientContainer <OrganizationalUnitIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

SMTPTemplateWithCustomFilter

New-EmailAddressPolicy [-Name] <String> -EnabledPrimarySMTPAddressTemplate <String> -RecipientFilter <String>
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Priority <EmailAddressPolicyPriority>]
 [-RecipientContainer <OrganizationalUnitIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

2 more parameter sets — see the parameter table below.

Parameters (31)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies the unique name of the email address policy. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-EnabledEmailAddressTemplates ProxyAddressTemplateCollection yes The EnabledEmailAddressTemplates parameter specifies the rules in the email address policy that are used to generate email addresses for recipients.
-EnabledPrimarySMTPAddressTemplate String yes The EnabledPrimarySMTPAddressTemplate parameter specifies the rule in the email address policy that's used to generate the primary SMTP email addresses for recipients. You can use this parameter instead of the...
-IncludedRecipients WellKnownRecipientType yes This parameter is available only in on-premises Exchange.
-IncludeUnifiedGroupRecipients SwitchParameter yes This parameter is available only in the cloud-based service.
-RecipientFilter String yes This parameter is available only in on-premises Exchange.
-ConditionalCompany MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute1 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute10 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute11 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute12 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute13 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute14 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute15 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute2 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute3 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute4 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute5 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute6 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute7 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute8 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalCustomAttribute9 MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalDepartment MultiValuedProperty This parameter is available only in on-premises Exchange.
-ConditionalStateOrProvince MultiValuedProperty This parameter is available only in on-premises Exchange.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DisabledEmailAddressTemplates ProxyAddressTemplateCollection This parameter is available only in on-premises Exchange.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-ManagedByFilter String This parameter is available only in the cloud-based service.
-Priority EmailAddressPolicyPriority The Priority parameter specifies the order that the email address policies are evaluated. By default, every time that you add a new email address policy, the policy is assigned a priority of N+1, where N is the...
-RecipientContainer OrganizationalUnitIdParameter This parameter is available only in on-premises Exchange.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.