Share via


Create an email address policy by using recipient filters

Applies to: Exchange Server 2013

You can use the Shell to create an email address policy by using recipient filters. To learn more about email address policies, see Email address policies.

For additional management tasks related to email address policies, see Email address policy procedures.

What do you need to know before begin?

  • Estimated time to complete: 5 minutes.

  • To use the RecipientFilter parameter to create a custom filter, you must specify a string for the filter. The Shell uses OPath for the filtering syntax. OPath is a querying language designed to query object data sources.

    Important

    If you use a recipient filter to create or edit an email address policy, you can't use the Exchange admin center (EAC) to edit the email address policy. You must use the Shell. For detailed syntax and parameter information, see Set-EmailAddressPolicy.

  • You need to be assigned permissions before you can perform this procedure or procedures. To see what permissions you need, see the "Email address policies" entry in the Email addresses and address books topic.

  • Before an SMTP address domain can be used in an email address policy, you must configure an accepted domain. For more, see Accepted domains.

  • For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.

Warning

Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Server.

Use the Shell to create an email address policy by using recipient filters

To create an email address policy by using recipient filters, use the following syntax.

New-EmailAddressPolicy -Name <String> -RecipientFilter <String>

This example creates an email address policy that applies to all executives and for which the local part of the email address consists of the first two letters of their first name and their entire last name.

New-EmailAddressPolicy -Name 'Execs' -EnabledEmailAddressTemplates 'SMTP:%2g%s@contoso.com' -RecipientFilter "((RecipientType -eq 'UserMailbox') -and (Title -like 'executive'))"

For detailed syntax and parameter information, see New-EmailAddressPolicy.