Managing Distribution Group recipients

Scenario description

You can use distribution groups to create e-mail distribution lists. Distribution groups can be used only with e-mail applications such as Microsoft Outlook to send e-mail messages to collections of users.

In this scenario, you can use PowerShell to manage the recipients of a distribution group.

Managing recipients of a Distribution Groups

To begin, you will need to connect to Exchange Online.
$credential = Get-Credential
$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection
Import-PSSession $ExchangeSession
You can use the following command to add a recipient to a distribution group. In this example, you will need to replace DistributionGroupName with the name of the Distribution Group you want to modify and user@contoso.com with the recipient you want to add.
Add-DistributionGroupMember -Identity "DistributionGroupName" -Member "user@contoso.com"
You can use the following command to remove a recipient of a distribution group. In this example, you will need to replace DistributionGroupName with the Distribution Group you want to modify and user@contoso.com with the recipient you want to remove.
Remove-DistributionGroupMember -Identity "DistributionGroupName" -Member "user@contoso.com"
Comments

No Comments