How to Create an E-Mail Address Policy By Using Recipient Filters
Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.
Applies to: Exchange Server 2007, Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3
This topic explains how to use the Exchange Management Shell to create an e-mail address policy by using recipient filters. To learn more about e-mail address policies, see Understanding E-Mail Address Policies.
Note
You cannot use the Exchange Management Console to create an e-mail address policy by using recipient filters. You must use the Exchange Management Shell.
Before You Begin
To perform this procedure, the account you use must be delegated the following:
- Exchange Organization Administrator role
For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.
Also, before you perform this procedure, be aware of the following:
Before a Simple Mail Transfer Protocol (SMTP) address domain can be used in an e-mail address policy, you must configure an accepted domain. For information about configuring accepted domains, see Managing Accepted Domains.
To use the RecipientFilter parameter to create a custom filter, you must specify a string for the filter. The Exchange Management Shell uses OPath for the filtering syntax. OPath is a querying language designed to query object data sources. For more information about the OPath filtering syntax, see Creating Filters in Recipient Commands.
Important
If you use a recipient filter to create or edit an e-mail address policy, you cannot use the Exchange Management Console to edit the e-mail address policy. You must use the Set-EmailAddressPolicy in the Exchange Management Shell. For detailed syntax parameter information, see Set-EmailAddressPolicy.
Procedure
To use the Exchange Management Shell to create an e-mail address policy by using recipient filters
Run the following command:
New-EmailAddressPolicy -Name <String> -RecipientFilter <String>
For example, to create an e-mail address policy that applies to all executives and for which the local part of the e-mail address consists of the first two letters of their first name and their entire last name, run the following command.
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 the New-EmailAddressPolicy reference topic.
For More Information
To learn more about e-mail address policies, see Understanding E-Mail Address Policies.
For more information about managing e-mail address policies, see Managing E-Mail Address Policies.
For more information about accepted domains, see the following topics: