Exchange – Get Members of a Dynamic Distribution Group

All a Dynamic Distribution Group is is a powershell filter, which is used to pull the appropriate users into an email list on the spot when an email is sent to the DDL (dynamic distribution list).

Powershell Commands

#Assign the recipient filter to a variable

$RecipientFilter = (Get-DynamicDistributionList "<group name>").RecipientFilter

#Pull the list of in-scope recipients by using $RecipientFilter

Get-Recipient -RecipientPreviewFilter $RecipientFilter

Other export options

#Just names

Get-Recipient -RecipientPreviewFilter $RecipientFilter | Select Name

#Export to a .txt file

Get-Recipient -RecipientPreviewFilter $RecipientFilter > c:\path\to\file.txt

Note on Exchange Powershell module dependencies

My local machine had missing dependencies to run the above commands. If you see the error below, you can just RDP or console into one of the Exchange servers and run the commands locally on Exchange.

WARNING: An unexpected error has occurred and a Watson dump is being generated: Could not load file or assembly 'Microsoft.Exchange.ManagedLexRuntime.MPPGRuntime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
Get-Recipient : Could not load file or assembly 'Microsoft.Exchange.ManagedLexRuntime.MPPGRuntime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:1 char:1
+ Get-Recipient -RecipientPreviewFilter $RecipientFilter
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Recipient], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Exchange.Management.RecipientTasks.GetRecipient