Exchange 2007 – Creating Dynamic Distribution Lists

Unlike a regular distribution group, a dynamic distribution group, as the name implies, is dynamic in nature.

Instead of having a list of users as with a standard distribution group, a dynamic distribution group is built each time an email is sent to it.

This is accomplished by utilizing a Lightweight Directory Access Protocol (LDAP) query that has been defined and assigned to the group. For example, you can build a dynamic distribution group that is intended to include all recipients in a particular Active Directory Organisational Unit. Each time the list is accessed, the membership would be built based on information gathered from the AD.

 

To create a dynamic distribution list based on a specific “Office” location (i.e. Corporate Office, Level 1) you’ll need to run the following PowerShell command:

new-DynamicDistributionGroup -Name "Corporate Office - Level 1" -OrganizationalUnit domain.local/corporate/users -RecipientFilter { (RecipientType -eq 'UserMailbox') -and ((Office -eq 'Corporate Office, Level 1') -or (Office -eq 'Corporate, Level 1')) }

 

This will create:

  • the list name:  Corporate Office – Level 1
  • its targeted at user in the OU:  domain.local/corporate/users
  • the type of user is:  ‘UserMailbox’
  • the “Office” attribute can be either:  Corporate Office, Level 1 OR Corproate, Level 1

 

To change any settings in a Dynamic Distribution List you can run the following PowerShell command (modify the details which need to be updated):

Set-DynamicDistributionGroup -Name "Corporate Office - Level 1" -OrganizationalUnit domain.local/corporate/users -RecipientFilter { (RecipientType -eq 'UserMailbox') -and ((Office -eq 'Corporate Office, Level 1') -or (Office -eq 'Corporate, Level 1')) }

You can use the Exchange Management Console to “Preview” the group membership via the properties of the Distribution List (via the “Filter” tab).  An entry will also be placed in the AD group for each Distribution List.

Was this article helpful?

Related Articles