EmailAddressPolicy for Exchange 2010 /hosting [One organization, multiple primary domains]

Printer-friendly versionPDF version
Exchange 2010 Hosting


If you are running Exchange 2010 in hosting mode then you will probably run across a client that wants everyone to be in the same organization so they can see everyone in the GAL, but also wants some users to have a primary domain that is different than others.

After messing with the ConditionalCompany and other Conditional fields I believe I found a better way to accomplish this without even having to mess with anything in Active Directory Users & Computers.

So the first thing you want to do is add the extra domain as an accepted domain:

  • New-AcceptedDomain -Name  -DomainName "My First Org"

Next you will want to create your email address policy. Instead of setting the conditional fields we are just going to set the RecipientFilter to something custom. Using the UserPrincipalName will allow us to apply this policy based on their UPN (also the accepted domain you just added).

  • New-EmailAddressPolicy -Organization ORGANIZATIONNAME -NameDOMAINNAME -EnabledEmailAddressTemplate SMTP:@NEWDOMAIN -RecipientFilter {((UserPrincipalName -like '*@NEWDOMAIN') -and (Alias -ne $null))}

Completed Example:

  • New-EmailAddressPolicy -Organization "My First Org" -EnabledEmailAddressTemplates -RecipientFilter {((UserPrincipalName -like '*') -and (Alias -ne $null))}

This policy will only apply to the users that were created with the accepted domain.

Due to a weird issue with Exchange 2010 /hosting the Update-EmailAddressPolicy does not seem to work. If you want to apply this after the fact you have to use the Set-Mailbox command. It seems to update when you do that.


  • Get-Mailbox -Organization "My First Org" | Set-Mailbox

There are some variables you can use when setting your EnabledEmailAddressTemplates:

  • %g [First Name / Given name]
  • %s [Last Name / Surname]
  • %i [Middle Initial]
  • %m [Exchange Alias]
  • %d [Display Name]

The cool thing that you can do is specify a number which represents the amount of characters you want to include from the first name or last name. So lets take the user: Jacob Dixon

  • []
  • []
  • []

So if you wanted the users first initial and last name, and also last name plus the first initial to be automatically applied you would have to set your email address policy like this: [Keep in mind using a capitalized SMTP specifies the primary domain and uses lower case smtp specifies secondary or extra domains. You can only use one SMTP]

  • New-EmailAddressPolicy -Organization "My First Org", -RecipientFilter {((UserPrincipalName -like '*') -and (Alias -ne $null))}


Thanks a LOT.. was struggling for this frm last few days .. Thanks BOSS>

Good.. infact great article/ help

Happiness ALways...


Thanks, i spent ages trying to run the update-emailaddresspolicy command and even if you pipe it from a get it still doesnt work.

Get-Mailbox -Organization "My First Org" | Set-Mailbox works a treat and you can test it by running

Get-Mailbox -Organization "My Org" | fl emailaddresses

Post new comment