Loading

How to list Exchange Online Dynamic Distribution Group members

The below will allow you to list the members of a dynamic distribution group

Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

$DDG = Get-DynamicDistributionGroup "My DL Name"
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter -OrganizationalUnit $DDG.RecipientContainer

Remove-PSSession $Session

Leave a Reply

Your email address will not be published. Required fields are marked *