View Categories

Update 365 groups by PowerShell

< 1 min read

Connect to Exchange Online via PowerShell

Search for Specific group #

Get-UnifiedGroup -Filter {DisplayName -like "Data_Archive*"} 

Search for all groups #

Get-UnifiedGroup -Filter 

Search for all groups without Teams #

Get-UnifiedGroup -Filter {ResourceProvisioningOptions -ne "Team"}

Update the groups #

To update the groups, add the following code to the end of the script.

| Foreach-Object { Set-UnifiedGroup -Identity $_.Name -PrimarySmtpAddress "$($_.Alias)@emaildomain.com"}

Example:

Get-UnifiedGroup -Filter {ResourceProvisioningOptions -ne "Team"} | Foreach-Object { Set-UnifiedGroup -Identity $_.Name -PrimarySmtpAddress "$($_.Alias)@emaildomain.com"}
Updated on April 19, 2025

Leave a Reply

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

Scroll to Top