Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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"
}
@mardahl

This comment has been minimized.

Copy link
Owner Author

mardahl commented Aug 29, 2018

One that I use often during hybrid migrations to Office 365, so leaving it here for others to use :)

@mardahl

This comment has been minimized.

Copy link
Owner Author

mardahl commented Sep 2, 2018

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
You can’t perform that action at this time.