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"}