In previous parts I’ve explained users’ bulk creation (Part II) and bulk modification (Part III).

In this part let’s talk about more advanced management tasks.

Dynamic Distribution Groups:

Dynamic Distribution Group (DDG) is special group created based on conditions not based on list of members as the normal group. Membership of the DDG is calculated each time an email is sent to the DDG, the calculation is based on the filters and conditions specified during the creation of the DDG.

There are two types of the DDG:

- Precanned filters: this the easy DDG where we can use the following filters:

o Recipient type.

o Company.

o Custom attribute.

o Department

o State.

- Customized filter: where we can use any attribute

Before starting with creating the DDGs, our challenge here is not creating DDG, as the title of these series it’s about Arabization. So the challenge is to create Arabic DDG with Arabic conditions.

You will need to review Part I which discussing how to use Windows PowerShell ISE to solve the Arabic problem.

Once you have ISE installed we will need to connect to the tenant and remember DDG is for Emails so yes this will need connecting to Exchange Online:

1. Connect to the tenant (AD): Connect-MsolService

2. Connect to Exchange Online:

$cred=Get-Credential

$session=New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri:https://ps.outlook.com/powershell -Credential:$cred -Authentication basic -AllowRedirection

Import-PSSession $session

Now we are connected to Exchange Online and you can use Exchange cmdlets

Let’s check the DDG examples:

 

Precanned Filters:

Target is: create DDG with only users live in "التجمع الخامس".

From the above explanation in Precanned filters DDG we can filter by State (not city), so as you see in the following snapshot, we have some users in "التجمع الخامس", some users in "الهرم", and other users State value is empty.

clip_image002

The challenge is when using the following cmdlet with only the mandatory attributes:

New-DynamicDistributionGroup -Name التجمع الخامس"" -IncludedRecipients mailboxusers -ConditionalStateOrProvince "التجمع الخامس”

Check the following result of Get-DynamicDistributionGroup |fl

clip_image004

In the above snapshot, check the marked values:

- Alias

- EmaildAddresses

- PrimarySmtpAddress

As you can see the values are Arabic and driven from the name specified in the first cmdlet "التجمع الخامس" and of course this DDG will not work, because these values are only supported in English (until that day when we see my email محمد@مرزوق.مصر).

So what we need is to create the DDG using the following cmdlet:

New-DynamicDistributionGroup -Name "التجمع الخامس" -IncludedRecipients mailboxusers -ConditionalStateOrProvince "التجمع الخامس" -Alias Tagamo3 -PrimarySmtpAddress tagamo3@meamcs.com

Then check the properties of the DDG:

clip_image006

Now these attributes in English. However the display name is still in Arabic, so the users will see the DDG in Arabic.

Now let’s move to another topic, how are we going to make sure that this DDG is really working and the users in التجمع الخامس are members of this group.

Remember this is not a static membership, so what we need to do is to calculate the members of this DDG:

$ddg=Get-DynamicDistributionGroup "التجمع الخامس"

Get-Recipient -RecipientPreviewFilter $ddg.RecipientFilter

clip_image008

Customized Filters:

This is more advanced where we can use any attribute and use AND, OR.

The target is to create DDG for users with mailbox and with title “استشاري”.

Let’s first check our users:

clip_image010

As explained before we will need to specify Alias, PrimarySMTPAddress values to get healthy DDG:

New-DynamicDistributionGroup -Name استشاري -Alias isteshary -PrimarySmtpAddress isteshary@meamcs.com -RecipientFilter {(recipienttype -eq "usermailbox") -and (title -like "استشاري")}

In the above cmdlet the filter we have used is recipienttype was equal to usermailbox and this mailbox user must also has titleاستشاري .

Let’s do final check to see the members of this DDG:

clip_image012

In this part I’ve explained the Dynamic Distribution Groups, next part we will talk about some reporting and filtering cmdlets.

 

Previous Parts:

Part I: Arabic Problems

Part II: Users Bulk Creation

Part III: Users Bulk Modification

Part IV: Dynamic Distribution Group