Create a Dynamic Distribution Group by Office

Using the Exchange Management Console in Exchange 2010 to create a Dynamic Distribution Group only allows for a limited number of conditions, such as State, Department or Company. As is often the case PowerShell is the way to get around this.

This example uses the New-DynamicDistributionGroup cmdlet with the RecipientFilter property to create a DDG called “Newport Users” for users that have their Office attribute set as “Newport” in Active Directory:

New-DynamicDistributionGroup -Name “Newport users” -OrganizationalUnit “OU=Distribution groups,DC=mydomain,DC=local” -RecipientContainer “OU=Users,DC=mydomain,DC=local” -RecipientFilter {RecipientType -Eq 'UserMailbox' -And Office -Eq 'Newport'}

You can see a list of filterable properties here:

[BlogBookmark] [Blogsvine] [] [Digg] [Facebook] [Furl] [Google] [LinkedIn] [MySpace] [Reddit] [Slashdot] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]