In this blog post, I’ll show you how to view Exchange Online Dynamic Distribution Group members using PowerShell.
About Dynamic Distribution Group
Dynamic Distribution Groups allow us to create Mail Enabled Dynamic Distribution Groups based on pre-defined rules without adding members manually.
Once created, the membership calculation is done every time a message is sent to the group.
Create A Dynamic Distribution Group
In the example below, I’ll create Dynamic Distribution Group for the Sales department.
Below, I added a rule that makes any user with the work Sales In the department filed.
You can see how the rule looks like below
Currently, Exchange Online allows us to view Members of Dynamic Distribution Group using the Exchange Online PowerShell Module.
To get started, I’ll connect to Exchange Online using PowerShell
I’ll run the cmdlet below with the Dynamic Distribution Group name
$x = Get-DynamicDistributionGroup "DL_Sales"
And run the line below to view the members of the Dynamic Distribution Group
Get-Recipient -RecipientPreviewFilter $x.RecipientFilter
Dynamic Distribution Groups are very PowerShell in Exchange Online and allows us to set and forget groups.
My recommendation Is to use Dynamic Distribution Groups one ever possible because it’s easier to manage and Dynamically configured.