Exchange Online create dynamic distribution groups

Start a Powershell session with Exchange online

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

Import-PSSession $Session -DisableNameChecking

#Create Dynamic distribution group
New-DynamicDistributionGroup -Name Test-Dynamic Group -Alias Test-DynamicGroup-DL -RecipientFilter {(Department -like “Engineering*”) -and (Title -like “Engineer Services”)}

#Change dynamic distribtuion group
Set-DynamicDistributionGroup -Identity “[email protected]” -RecipientFilter {Department -like “Engineering & Construction”}

#Get Members of a dynamic distribution group :
Get-Recipient -RecipientPreviewFilter (Get-DynamicDistributionGroup -Identity ‘Test-Dynamic-DL’).RecipientFilter -ResultSize unlimited

Leave a Reply

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