Oct 18 2018
- last edited on
Feb 01 2023
A customer site as set up with the .onmicosoft.customer domain as standard. So most groups is generated with firstname.lastname@example.org and not email@example.com.
Where do we change that?
Oct 18 2018 07:31 AMSolution
Oct 18 2018 07:35 AM
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 firstname.lastname@example.org
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.
Mar 29 2023 05:45 PM
Just a supplement here: