E-mail Address Policy Based on Country

There are a ton of things that the Exchange team did to improve manageability in Exchange Server 2007. This is evident in the number of new rule based wizards that appear throughout the Exchange Management Console. However there are still quite a few things that an administrator needs to handle via the trusty Exchange Management Shell. One of those is the creation of custom E-mail address policies.

This particular bit of EMS code will allow for the creation of an E-mail address policy called North America that is based on the Co or country attribute in Active Directory. Of course we have chosen United States, Canada, and Mexico for this particular one but you could easily modify the syntax to create an unlimited number of combinations.

New-EmailAddressPolicy -Name 'North America' -EnabledEmailAddressTemplates 'SMTP:@contoso.com' -RecipientFilter {((Co -eq 'United States') -or (Co -eq 'Canada') -or (Co -eq 'Mexico'))}

At this point don’t worry about getting fancy with the SMTP addresses. Once this new policy is created you can use the E-mail Address Policy wizard to customize the addresses. The important thing is that the recipient filter must be created via the EMS.

Leave a Reply

Your email address will not be published.