SOLVED

Change domain for Office 365 groups.

Steel Contributor

Hi,

 

A customer site as set up with the .onmicosoft.customer domain as standard. So most groups is generated with group@customer.onmicrosoft.com and not group@customer.com.

 

Where do we change that?

 

Bet regards

 

- Geir

7 Replies
Please read a link to a similar thread! You’ll find the answer with some scrolling!

Adam
best response confirmed by Geir Hogstad (Steel Contributor)

Hey Geir,


There can be a few things causing this. The first thing to look at is default domain. If you have a default domain of domain.com rather than .onmicrosoft.domain.com that is a great first step. 

 

Changing the default domain in and of itself will likely not solve your problem. You need that default domain to be enacting on your email address policy as well. (you can also skip the default domain step and just move forward to this one if you do not want to change it for whatever reason).

 

Update your email address policy so that it does what you need. With that said, you will NOT find this in the GUI, so get your powershell pants on :) - https://docs.microsoft.com/en-us/powershell/module/exchange/email-addresses-and-address-books/new-em...

 

You will ultimately need something like this:

 

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

 

When you execute that command, you should get an output that looks like a little grid, showing Name, Priority, and FIlter.

 

Once that is done, all your new groups will have the correct email address! Great but what about the old ones?

 

To do that I would recommend running a script to hit up all your existing groups and changing their primarysmtpaddress.

 

If you just have a few to do, then this is pretty easy. O365 groups use the powershell lingo of "unified group" and you will need to run a similar command for each one:

Set-UnifiedGroup -Identity "Example Group Name" -PrimarySmtpAddress example@domain.com

 

If you have a whole bunch of them, a loop would work best. In that case, I would export all current groups into a CSV file, then from there, add a column with the correct primarysmtpaddress. Import it back in and loop through the csv re-setting the primarysmtpaddress.

 

If you struggle doing the above, let me know and I should be able to help you with the code.

 

Adam

Hi,

 

It worked like a charm using Powershell as sugested.

 

Thank you

- Geir

Great!!

Adam

@Adam Ochs 

 

Get-UnifiedGroup | Where-Object {$.PrimarySmtpAddress -like "*@domain.onmicrosoft.com"} | ForEach-Object {Set-UnifiedGroup $.Identity -PrimarySmtpAddress ($_.Alias + "@domain.com")}

1 best response

Accepted Solutions