en-US

EmailAddressPolicy

Applies to : Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Server SE, Exchange Online, Built-in security add-on for on-premises mailboxes

This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings might be exclusive to one environment or the other.

Use the Set-EmailAddressPolicy cmdlet to modify email address policies. In Exchange Online, email address policies are available only for Microsoft 365 Groups.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

After you use the Set-EmailAddressPolicy cmdlet to modify an email address policy in an on-premises Exchange organization, you need to use the Update-EmailAddressPolicy cmdlet to apply the updated policy to recipients.

The Conditional parameters that are used with the IncludedRecipients parameter are subject to the following limitations:

  • The EQV operator is used for every property value, as in "Department equals Sales". Wildcards and partial matches aren't supported.
  • The OR operator is always used for multiple values of the same property, as in "Department equals Sales OR Marketing".
  • The AND operator is always used for multiple properties, as in "Department equals Sales AND Company equals Contoso".

To create flexible filters that use any available recipient property and that aren't subject to these limitations, you can use the RecipientFilter parameter to create a custom OPATH filter.

You can't use this cmdlet to replace a precanned filter with a custom OPATH filter, or vice-versa. You can only modify the existing filter.

You need to be assigned permissions before you can run this cmdlet. Although this article lists all parameters for the cmdlet, you might not have access to some parameters if they aren't included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet.

Available cmdlets

Parameters

Name Type Default value Accepted values
EnabledEmailAddressTemplates ProxyAddressTemplateCollection
EnabledPrimarySMTPAddressTemplate String
ForceUpgrade SwitchParameter
Name String
Priority EmailAddressPolicyPriority

Examples

Example 1

Set-EmailAddressPolicy -Identity "Southeast Executives" -ConditionalStateOrProvince @{Add="TX"}

In on-premises Exchange, this example modifies the existing email address policy named Southeast Executives by adding the State or province value TX (Texas) to the precanned recipient filter.

Example 2

Set-EmailAddressPolicy -Identity "Contoso Corp" -DisabledEmailAddressTemplates $null

In on-premises Exchange, this example clears the disabled email address templates from the email address policy named Contoso Corp.

Example 3

Set-EmailAddressPolicy -Identity "Office 365 Groups" -EnabledEmailAddressTemplates "SMTP:@contoso.com","smtp:@contoso.onmicrosoft.com","smtp:@contoso.microsoftonline.com"

In Exchange Online, this example modifies the existing email address policy named "Office 365 Groups" and sets the enabled email address templates to use "@contoso.com" as the primary SMTP address and "@contoso.onmicrosoft.com" and "@contoso.microsoftonline.com" as proxy addresses.

Microsoft Learn documentation