exchange-2007-shell-logo In some companies different departments or branch offices require different primary SMTP addresses.  You can configure these for users with Email Address Policies.  In this example the company wants all users to have an address, but each branch office’s users have a primary email address representing that branch.

First we must make sure each of the domains is included as an Accepted Domain, using the New-AcceptedDomain cmdlet.

[PS] C:\>New-AcceptedDomain -Name 'Sydney' -DomainName ''

Name                           DomainName                     DomainTy Default
----                           ----------                     -------- -------
Sydney                            Autho... False

[PS] C:\>New-AcceptedDomain -Name 'Brisbane' -DomainName ''
-DomainType Authoritative

Name                           DomainName                     DomainTy Default
----                           ----------                     -------- -------
Brisbane                        Autho... False

[PS] C:\>New-AcceptedDomain -Name 'Melbourne' -DomainName '
' -DomainType Authoritative

Name                           DomainName                     DomainTy Default
----                           ----------                     -------- -------
Melbourne                      Autho... False

[PS] C:\>New-AcceptedDomain '' -DomainName '' -DomainType

Name                           DomainName                     DomainTy Default
----                           ----------                     -------- -------                              Autho... False

Then we can configure the Email Address Policies using the New-EmailAddressPolicy cmdlet.  In this example I am using the “Office” user attribute to filter recipients.

[PS] C:\>New-EmailAddressPolicy -Name 'Sydney' -RecipientFilter {(Office -eq 'Sy
dney')} -EnabledEmailAddressTemplates '','smtp:%g.%'

Name                       Priority                   RecipientFilter
----                       --------                   ---------------
Sydney                     1                          Office -eq 'Sydney'

[PS] C:\>New-EmailAddressPolicy -Name 'Brisbane' -RecipientFilter {(Office -eq '
Brisbane')} -EnabledEmailAddressTemplates '','smt'

Name                       Priority                   RecipientFilter
----                       --------                   ---------------
Brisbane                   2                          Office -eq 'Brisbane'

[PS] C:\>New-EmailAddressPolicy -Name 'Melbourne' -RecipientFilter {(Office -eq
'Melbourne')} -EnabledEmailAddressTemplates '',''

Name                       Priority                   RecipientFilter
----                       --------                   ---------------
Melbourne                  3                          Office -eq 'Melbourne'

Here is the result for a recipient who matches the filter for the Sydney policy.

[PS] C:\>Get-Recipient 'Peter Grover' | fl Office,Emailaddresses

Office         : Sydney
EmailAddresses : {, SMTP:Peter.Grover@}

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for


  1. Sandeep K M

    Can I create templeate like
    -EnabledEmailAddressTemplates ‘’ ?
    or -EnabledEmailAddressTemplates ‘’

  2. Peter Nørredal

    Hi Paul
    Thanks for your reply

    hmm, sounds odd if this senario doesn´t Work.(I surely hope it does, somehow)

    Because next step for me in this is creating Linked mailboxes” which also should rely on OU´s in a different domain+forest, – or in general People that are not located Intra-forest … Or am I missing something here ??

    Do you know about a forum/good website where I might get help /confimation regarding the above ?


  3. Peter Nørredal

    Hi Paul
    I´m trying to create an email addresse policy from powershell, for users located on a different domain (Trust between AD forests) – from my mailbox server, located on my Hosting.local domain.

    I´m connected to the other forest, from this command:
    Get-ADOrganizationalUnit -Identity “OU=$CustomerName,OU=customers,DC=Domain,DC=local” –Server ‘DC01.domain.local’| FL

    (with Customername =
    No issues here 🙂

    BUT, when I try to create a new email address policy, pointing to the OU where the users are located on the domain: “Domain.local”, I get this error:

    ObjectNotFound: (,OU=Customers,DC=Domain,DC=local:ADOrganizationalUnit) [Get-ADOrganizationalUnit], ADIdentityNotFoundException

    (BUT, the OU is there !!)

    I´m running this command from powershell:

    $CustomerName = Read-Host “New E-mail Domain for new customer”

    Import-Module activedirectory
    Get-PSDrive –Name Domain –PSProvider ActiveDirectory –Server ‘DC01.domain.local’ –credential (Get-Credential ‘domainadministrator’) –root ‘//RootDSE/’

    New-EmailAddressPolicy -Name $CustomerName -RecipientContainer “domain.local/customers/$CustomerName” -IncludedRecipients ‘AllRecipients’ -ConditionalCustomAttribute1 $CustomerName -Priority ‘1’ -EnabledEmailAddressTemplates SMTP:%2g%1s@$AcceptedEmailDomain

    Hope you can help me
    Best regards

    1. Paul Cunningham

      I’ve never tried that scenario. Perhaps it is just a limitation that -RecipientContainer only works intra-forest.

Leave a Reply