It has been a while ago so it’s time for a new tutorial.</p>

This tutorial will be about dynamic distribution groups, a new feature in Exchange 2007. With a dynamic distribution group you can create a group which members will be selected according to a filter you specify. Each time a mail is send to this group a query will be done to select the users who are a member of the group.

There are two methods to create a dynamic distribution group:

  • via the Exchange Management Console
  • via the Exchange Management Shell

Dynamic Distribution Group via the Exchange Management Console

We start with the first method, for this you will need to startup the Exchange Management Console and go to groups via recipient configuration .

When you have selected the groups icon you can select the option new dynamic distribution group in the right menu to start the wizard.

You will be presented the screen above, here we can define a name for the new dynamic distribution group. When the name has been defined you can click on next

The next step is to define the filter, here we need to define from which OU the members will be selected. The other thing we can define here is which objects will be selected from the OU. Standard all objects will be selected but if you have an OU which different types of objects you can specify for example only Exchange Mailbox users.

When your statisfied with the filter click on next

The next step is to define the conditions which a user must met to be a member of the group. As you can see in the screenshot there are a few fields displayed at step 1. When you wish to use another field will need to create the group via the Exchange Management Shell.  This is described later in this tutorial.

In this case we would like to select all people who work in the IT department, therefor we select the option  Recipient is in a Department, in the lower part of the screen we must define the condition. By clicking on specified we can specify a value. When clicking on it you will see the following screenshot.

Here we specify the value which we want to use in our filter, in this case IT. When you have specified all values you can click on OK.

Now we have provided all necessary values we will get a short overview of what we are going to configure.

When we are satisfied with this we click on new, after this the new dynamic distribution group will be created.

Now we created the new group we would like to know which users are a member of it. To find this out we need to get the properties of the group.

Next thing is to select the tab conditions and push the button preview

An overview of the users who are a member of the group will be displayed.

Standard only mail from authenticated users will be accepted. This is to prevend people from the internet sending mail to this group. When you would like to enable this group for receiving mail from the internet we need to configure this. This can be done on the tab Mail Flow Settings

When you opened the tab select the item Message Delivery Restrictions and click the button properties.

In the upper part of the screen you will see accept messages from below that title you will find the option require that all senders are authenticated, remove the checkmark before the option to accept mail from the internet. 

Dynamic Distribution Group via the Exchange Management Shell

As mentioned earlier we can create a dynamic distribution group via two methods. The second method is via Powershell. You can do this by using the command new-DynamicDistributionGroup. It can be done via an easy or by are more complex way. Can we specify only a few fields in the EMC, in Powershell we can filter on much more fields.

But that's for later, let's start with the easy version:

New-DynamicDistributionGroup -IncludedRecipients MailboxUsers -Name "Rotterdam DDG" -OrganizationalUnit Rotterdam

The command above will select all users with an Exchange Mailbox from the OU Rotterdam and will add them to a dynamic distribution group Rotterdam DDG.

When we want to view the users who are a member of this group we need to use the following 2 commands:

$RotterdamOffice = Get-DynamicDistributionGroup -Identity "Rotterdam DDG"
Get-Recipient -RecipientPreviewFilter $RotterdamOffice.RecipientFilter (SP1)
Get-Recipient -Filter $RotterdamOffice.RecipientFilter (RTM)

The first rule will save the group in a parameter. The second rule will get all users from this distribution group. There are two versions of it, one for the RTM version and the other vor the SP1 version.

Now we showed the easy way let's make one via the complex way.

New-DynamicDistributionGroup -name Test  -RecipientFilter {(UserPrincipalName -like </em><em>'*@test.local'</em><em>)}</em></p>
<p>The command above will create a new distribution group with the name <em>Test. </em>Here we select only users with a UPN that ends with <em>test.local

You can make it more complex if you want, for example you can filter on more conditions

New-DynamicDistributionGroup -Name AllTestIT -OrganizationalUnit test.local/Utrecht/Users -RecipientFilter { ((RecipientType -eq 'UserMailbox') -and (Company -eq 'Test')) }

This command will create a new distribution group with the name AllTestIT and select the users only from the OU Utrecht/Users with an Exchange Mailbox and which are working at the company Test.

You can make it as complex as you want by adding more parameters. For a full overview of the fields you can use have a look at this site

Technet articles

How to Create a New Dynamic Distribution Group

Creating Filters in Recipient Commands

Filterable Properties for the -Filter Parameter in Exchange 2007 RTM

Filterable Properties for the -Filter Parameter in Exchange 2007 SP1

How to View Members of a Dynamic Distribution Group


Comments


Johan Veldhuis