
Predefined Filter Example
This example describes using precanned filters to create a dynamic distribution group. The syntax in the example commands is similar but not identical to the syntax you would use to create a new e-mail address policy, address list, or GAL.
When you create a dynamic distribution group with the New Dynamic Distribution Group wizard, you must choose the following filtering information:
-
From which organizational unit do you want to include recipients?
Note: |
|---|
|
Choosing the organizational unit from which you want to include recipients only applies to creating dynamic distribution groups, not to creating e-mail address policies, address lists, or GALs.
|
-
What type of recipients do you want to include?
-
What additional conditions do you want to include in the filter?
The following figures show the pages of the New Dynamic Distribution Group wizard on which you choose the filter information.
Figure 1 Filter Settings page of the New Dynamic Distribution Group wizard
.gif)
Figure 2 To select the organizational unit, click Browse on the Filter Settings page of the New Dynamic Distribution Group wizard
.gif)
Figure 3 Conditions page of the New Dynamic Distribution Group wizard
.gif)
Each of these filtering options corresponds to one of the precanned filter parameters in the New-DynamicDistributionGroup or Set-DynamicDistributionGroup commands.
The first filtering option for the organizational unit corresponds to the RecipientContainer parameter in the command. The second filtering option for type of recipients corresponds to the IncludedRecipients parameter. The third filtering option for additional conditions corresponds to the ConditionalCompany, ConditionalDepartment, ConditionalStateOrProvince, and ConditionalCustomAttribute parameters.
Note: |
|---|
|
The OrganizationalUnit parameter specifies the location for the new dynamic distribution group after it is created. The RecipientContainer parameter is a filter parameter that specifies the organizational unit where recipients that will be added to the dynamic distribution group reside.
|
For example, in the Dynamic Distribution Group wizard, you could select recipients from the Contoso.com/Users organizational unit, select UserMailbox objects, and select the condition to include only recipients who have Department defined as Finance and Company defined as Contoso.
To create the same dynamic distribution group using the Exchange Management Shell, run the following command:
New-DynamicDistributionGroup -Name ContosoFinance -OrganizationalUnit Contoso.com/Users -RecipientContainer Contoso.com/Users -IncludedRecipients MailboxUsers -ConditionalDepartment "Finance" -ConditionalCompany "Contoso"
To view the properties of this new distribution group, run the following command:
Get-DynamicDistributionGroup -Identity ContosoFinance | format-list *Recipient*,Included*
The RecipientFilter property displays the OPath filter syntax that was used to create this group. The RecipientFilterType property is Precanned, which means the filter for this group was created using the precanned filters. The LdapRecipientFilter property is a read-only property that displays what LDAP filter you would have used in previous versions of Exchange to create this group.