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 @company.com 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 'sydney.company.com'
Name DomainName DomainTy Default
pe
---- ---------- -------- -------
Sydney sydney.company.com Autho... False
[PS] C:\>New-AcceptedDomain -Name 'Brisbane' -DomainName 'brisbane.company.com'
-DomainType Authoritative
Name DomainName DomainTy Default
pe
---- ---------- -------- -------
Brisbane brisbane.company.com Autho... False
[PS] C:\>New-AcceptedDomain -Name 'Melbourne' -DomainName 'melbourne.company.com
' -DomainType Authoritative
Name DomainName DomainTy Default
pe
---- ---------- -------- -------
Melbourne melbourne.company.com Autho... False
[PS] C:\>New-AcceptedDomain 'Company.com' -DomainName 'company.com' -DomainType
Authoritative
Name DomainName DomainTy Default
pe
---- ---------- -------- -------
Company.com company.com 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.%s@sydney.company.com','smtp:%g.%
s@company.com'
Name Priority RecipientFilter
---- -------- ---------------
Sydney 1 Office -eq 'Sydney'
[PS] C:\>New-EmailAddressPolicy -Name 'Brisbane' -RecipientFilter {(Office -eq '
Brisbane')} -EnabledEmailAddressTemplates 'SMTP:%g.%s@brisbane.company.com','smt
p:%g.%s@company.com'
Name Priority RecipientFilter
---- -------- ---------------
Brisbane 2 Office -eq 'Brisbane'
[PS] C:\>New-EmailAddressPolicy -Name 'Melbourne' -RecipientFilter {(Office -eq
'Melbourne')} -EnabledEmailAddressTemplates 'SMTP:%g.%s@melbourne.company.com','
smtp:%g.%s@company.com'
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@company.com, SMTP:Peter.Grover@sydney.company.com}




Leave a Reply