Create Dynamic Distribution Groups Using Customized Filters
Use customized filters to create dynamic distribution groups when the attributes that you want to use aren't available with precanned filters, or when you want to use wildcard matches. For example, if you create a dynamic distribution group that filters on the Department attribute value "R*" and the Title attribute "Engineer", messages sent to this group are delivered only to user accounts that have those attributes.
To learn how to create dynamic distribution groups using precanned filters, see Create Dynamic Distribution Groups Using Precanned Filters.
You create and modify dynamic distribution groups using Windows PowerShell. A customized filter requires use of OPATH, the filtering syntax used by Windows PowerShell.
Before you begin
To learn how to install and configure Windows PowerShell and connect to Outlook Live, see Use Windows PowerShell.
When you create your customized filter:
- Use braces { } around the whole OPATH syntax string.
- Include the hyphen before all operators.
- Remember these most frequently used operators.
-and | -lt (less than) |
-or | -gt (greater than) |
-not | -like (string comparison) |
-eq (equals; not case-sensitive) | -notlike (string comparison) |
-ne (does not equal; not case-sensitive) | Note When you use the -like or -notlike operators, you must use a wildcard in the string. For example, Department -like '*Sales'. |
To use a customized filter to create a new dynamic distribution group
Run the following command after you have connected to the Outlook Live session:
New-DynamicDistributionGroup -Name <group name> -RecipientFilter {<custom filter attribute conditions>}
Example Here's a command that uses a customized filter to create a new dynamic distribution group named "Washington Management Team". A message sent to this dynamic distribution group will be delivered to all users in Washington State whose titles start with "Director" or "Manager".
To create a new dynamic distribution group by using a customized filter, run the following command after you have connected to the Outlook Live session:
New-DynamicDistributionGroup -Name "Washington Management Team" -RecipientFilter {(RecipientType -eq 'UserMailbox') -and (Title -like 'Director*' -or Title -like 'Manager*') -and (StateOrProvince -eq 'WA')}
Add recipient filters to a dynamic distribution group
When you use dynamic distribution groups to send e-mail messages, you may unintentionally send messages to system mailboxes. Some system mailboxes reject e-mail sent directly to them. This generates a non-delivery report (NDR). To prevent messages from being sent to system mailboxes, you can add additional recipient filters to your dynamic distribution groups.
Display default recipient filters
Before you add recipient filters, you can run the following command to display the additional recipient filters that Microsoft Exchange automatically applies to all dynamic distribution groups to help prevent message delivery to system mailboxes:
Get-DynamicDistributionGroup <name> | Format-List Name,RecipientFilter
For example, the output of this command displays the following information about the "Washington Management Team" dynamic distribution group created in the previous example:
Name: Washington Management Team
RecipientFilter: ((((((RecipientType -eq 'UserMailbox') -and (((Title -like 'Director*') -or (Title -like 'Manager*'))))) -and (StateOrProvince -eq 'WA'))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
Because of the default recipient filters that were automatically added, messages sent to this dynamic distribution group won't be sent to any of the following:
- Mailboxes that have "SystemMailbox" or "CAS_" in the value of Name
- Mailbox plans
- Arbitration mailboxes
Add more recipient filters to help avoid NDRs
Here's a command to add additional recipient filters that aren't included in the default recipient filters to the "Washington Management Team" dynamic distribution group:
Set-DynamicDistributionGroup "Washington Management Team" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Title -like 'Director*' -or Title -like 'Manager*') -and (StateOrProvince -eq 'WA') -and (Alias -ne $null) -and -not (Name -like "FederatedEmail*"))}
This command adds additional filters so that messages won't be sent to the following:
- Mailboxes that don't have a value for Alias
- Mailboxes that have "FederatedEmail" in the value of Name
Important When you add filters to an existing dynamic distribution group, be sure to include the existing recipient filters. Why? The Set-DynamicDistributionGroup cmdlet replaces the existing recipient filters with the value you specify. Also, you don't need to specify the default recipient filters. Exchange will add these filters automatically.
Did you know?
Here are some of the more interesting Outlook Live recipient properties that you can use with customized filters. Note that this table doesn't include every available property for an Outlook Live recipient.
Property name | Available for Outlook Live recipient types | Value type | Wildcard character accepted? | Property visible in the Web management interface |
City |
| String | Yes | Yes |
Company |
| String | Yes | Yes |
CountryOrRegion |
| String The string is based on the ISO 3166 two-letter country code or the name of the country or region. You can find the valid values for the CountryOrRegion parameter from the Country/Region field in the Contact Information section of the account properties in the Web management interface. | No | Yes |
CustomAttributeN where N is an integer from 1 through 15. |
| String | Yes | No |
Department |
| String | Yes | Yes |
Manager |
| String | Yes | Yes |
Notes |
| String | Yes | Yes |
Office |
| String | No | Yes |
PostalCode |
| String | Yes | Yes |
RecipientType | All recipient types |
| No | Not applicable |
StateOrProvince |
| String | Yes | Yes |
StreetAddress |
| String | No | Yes |
Title |
| String | No | Yes |
No comments:
Post a Comment