Create E-mail address policy based on group membership

To create a e-mail address policy based on a group membership use the following command:
 
New-EmailAddressPolicy "<Policyname>" -RecipientFilter {((MemberOfGroup -eq "<Distinguished Name of the group>"))} -EnabledPrimarySMTPAddressTemplate ‘<Address syntax>’
 
For example:
New-EmailAddressPolicy "Test – Sundis Users 3" -RecipientFilter {((MemberOfGroup -eq "CN=Sundis Users 3,OU=Groups,OU=Sundis,DC=sundis,DC=internal"))} -EnabledPrimarySMTPAddressTemplate ‘SMTP:%m@test.internal’
Advertisements

2 Responses to Create E-mail address policy based on group membership

  1. extremesanity says:

    Thanks! This worked beautifully. :D

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: