Created
August 29, 2018 19:24
-
-
Save mardahl/9154427d07f680cb8d427093f20a90f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Simple script to change all Unified Groups (Office 365 Groups) Primaty SMTP email address to a new domain. | |
#It's recomended to have a diferent email domain for Office 365 Groups, so they dont conflict with regular user and system mailboxes. | |
$groups = get-unifiedgroup | select-object name,alias | |
Foreach ($group in $groups) { | |
Set-UnifiedGroup –Identity "$($group.name)" –PrimarySmtpAddress "$($group.alias)@groups.contoso.com" | |
} |
In order to set a default email policy for Office 365 group creation, the following command can be used:
New-EmailAddressPolicy -Name Groups -IncludeUnifiedGroupRecipients -EnabledEmailAddressTemplates "SMTP:@groups.contoso.com" -Priority 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One that I use often during hybrid migrations to Office 365, so leaving it here for others to use :)