Changing M365 Group domain, potential conflicts?

Copper Contributor

Hi All,

 

I have a question with regards to updating the EmailAddressPolicy on our tenant. We have previously used the default onmicrosoft.com domain for all M365 Groups created on the tenant and now we want to update the EmailAddressPolicy to use our corporate domain abc.com.

 

Question: Is there not a potential risk of running into a conflict with an existing onPrem SMTP being duplicated on a M365 Group when the domain is updated on the M365 groups?

Is there a good way to mitigate this other than comparing all 9000 M365 groups with existing onPrem SMTP addresses or does this require Groups writeback?

 

My thought is to do the following:

 

New-EmailAddressPolicy -Name Groups -IncludeUnifiedGroupRecipients -EnabledEmailAddressTemplates "SMTP:@contoso.com" -Priority 1

 

Then run a script to update the SMTP addresses of all existing M365 Groups.

 

$AllMailboxes = Get-UnifiedGroup -ResultSize Unlimited
Foreach ($Mailbox in $AllMailboxes)
{
$NewAddress = $Mailbox.Alias + “@contoso.com”
Set-UnifiedGroup -Identity $Mailbox.Alias -EmailAddress $NewAddress

 

1 Reply
Yes, there is some risk, but the worst that could happen is you get a dirsync error. Group writeback is definitely an overkill here though, if you want to have some sort of a safety net on-premises, create a bunch of contact (or any other object really) and populate their proxyAddresses with 100+ M365 Group email addresses each. Make sure to exclude them from the sync scope :)