#PSTip Preview the members of a dynamic distribution group

Note: This tip requires PowerShell 2.0 or above.

Getting the members of a dynamic distribution group in the Exchange Management Console (EMC) is not an issue; you open the group and click the Preview button.

preview

However, if you list the properties of the group in the Exchange Management Shell (EMS) you will not find the members as they are determined at the run time by the custom filter used when the group was created. Viewing the members of the group is twofold–you get the group’s recipient filter and use it with the Get-Recipient cmdlet!

$ddg = Get-DynamicDistributionGroup ITUsers
Get-Recipient –RecipientPreviewFilter $ddg.RecipientFilter

About the author: Shay Levy

Shay Levy is a Co-founder and editor of the PowerShell Magazine. He is a multiple-year recipient of the Microsoft MVP award, and a Microsoft Certified Trainer (MCT). Shay often covers PowerShell related topics on his blog and you can also follow him on Twitter at @ShayLevy

Related Posts

%d bloggers like this: