SOLVED

Change domain for Office 365 groups.

%3CLINGO-SUB%20id%3D%22lingo-sub-275266%22%20slang%3D%22en-US%22%3EChange%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275266%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20customer%20site%20as%20set%20up%20with%20the%20.onmicosoft.customer%20domain%20as%20standard.%20So%20most%20groups%20is%20generated%20with%20group%40customer.onmicrosoft.com%20and%20not%20group%40customer.com.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%20do%20we%20change%20that%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBet%20regards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20Geir%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-275266%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%20Groups%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-276260%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-276260%22%20slang%3D%22en-US%22%3EGreat!!%3CBR%20%2F%3E%3CBR%20%2F%3EAdam%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-276248%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-276248%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20worked%20like%20a%20charm%20using%20Powershell%20as%20sugested.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3CP%3E-%20Geir%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275312%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275312%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Geir%2C%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThere%20can%20be%20a%20few%20things%20causing%20this.%20The%20first%20thing%20to%20look%20at%20is%20default%20domain.%20If%20you%20have%20a%20default%20domain%20of%20domain.com%20rather%20than%20.onmicrosoft.domain.com%20that%20is%20a%20great%20first%20step.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChanging%20the%20default%20domain%20in%20and%20of%20itself%20will%20likely%20not%20solve%20your%20problem.%20You%20need%20that%20default%20domain%20to%20be%20enacting%20on%20your%20email%20address%20policy%20as%20well.%20(you%20can%20also%20skip%20the%20default%20domain%20step%20and%20just%20move%20forward%20to%20this%20one%20if%20you%20do%20not%20want%20to%20change%20it%20for%20whatever%20reason).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUpdate%20your%20email%20address%20policy%20so%20that%20it%20does%20what%20you%20need.%20With%20that%20said%2C%20you%20will%20NOT%20find%20this%20in%20the%20GUI%2C%20so%20get%20your%20powershell%20pants%20on%20%3A)%3C%2Fimg%3E%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Femail-addresses-and-address-books%2Fnew-emailaddresspolicy%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Femail-addresses-and-address-books%2Fnew-emailaddresspolicy%3Fview%3Dexchange-ps%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20ultimately%20need%20something%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENew-EmailAddressPolicy%20-Name%20Groups%20-IncludeUnifiedGroupRecipients%20-EnabledEmailAddressTemplates%20%22SMTP%3A%40domain.com%22%20-Priority%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20execute%20that%20command%2C%20you%20should%20get%20an%20output%20that%20looks%20like%20a%20little%20grid%2C%20showing%20Name%2C%20Priority%2C%20and%20FIlter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20that%20is%20done%2C%20all%20your%20new%20groups%20will%20have%20the%20correct%20email%20address!%20Great%20but%20what%20about%20the%20old%20ones%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20do%20that%20I%20would%20recommend%20running%20a%20script%20to%20hit%20up%20all%20your%20existing%20groups%20and%20changing%20their%20primarysmtpaddress.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20just%20have%20a%20few%20to%20do%2C%20then%20this%20is%20pretty%20easy.%20O365%20groups%20use%20the%20powershell%20lingo%20of%20%22unified%20group%22%20and%20you%20will%20need%20to%20run%20a%20similar%20command%20for%20each%20one%3A%3C%2FP%3E%3CP%3ESet-UnifiedGroup%20-Identity%20%22Example%20Group%20Name%22%20-PrimarySmtpAddress%20example%40domain.com%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20a%20whole%20bunch%20of%20them%2C%20a%20loop%20would%20work%20best.%20In%20that%20case%2C%20I%20would%20export%20all%20current%20groups%20into%20a%20CSV%20file%2C%20then%20from%20there%2C%20add%20a%20column%20with%20the%20correct%20primarysmtpaddress.%20Import%20it%20back%20in%20and%20loop%20through%20the%20csv%20re-setting%20the%20primarysmtpaddress.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20struggle%20doing%20the%20above%2C%20let%20me%20know%20and%20I%20should%20be%20able%20to%20help%20you%20with%20the%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdam%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275309%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275309%22%20slang%3D%22en-US%22%3EForgot%20to%20attach%20the%20link%20%3A)%3C%2Fimg%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FOffice-365-Groups%2FIs-there-a-way-to-change-O365-group-email-address-using%2Ftd-p%2F49872%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FOffice-365-Groups%2FIs-there-a-way-to-change-O365-group-email-address-using%2Ftd-p%2F49872%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-275308%22%20slang%3D%22en-US%22%3ERe%3A%20Change%20domain%20for%20Office%20365%20groups.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-275308%22%20slang%3D%22en-US%22%3EPlease%20read%20a%20link%20to%20a%20similar%20thread!%20You%E2%80%99ll%20find%20the%20answer%20with%20some%20scrolling!%3CBR%20%2F%3E%3CBR%20%2F%3EAdam%3C%2FLINGO-BODY%3E
Highlighted
Frequent 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

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

Adam
Highlighted
Best Response confirmed by Geir Hogstad (Frequent Contributor)
Highlighted

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

Highlighted

Hi,

 

It worked like a charm using Powershell as sugested.

 

Thank you

- Geir

Highlighted
Great!!

Adam