question

Marcus avatar image
0 Votes"
Marcus asked

Office 365 Group not created for default domain

Hi,

I have two verified domains in Office 365 and is working with Microsoft Graph to manage groups for these domains.

The problem
Im experiencing a delay after changing "default domain", until its possible to create a group for that domain.
Due to this delay, the group I create ends up with wrong domain.

Example
Lets say DomainA.com is "default" and I update and set DomainB.com as the "default domain" (because I want to create a group for domainB.com).
Microsoft Graph returns OK when I do this update, and I can also see in Office 365 Admin Center that domainB.com is immediately marked as "default domain".

If I now create a group it will get domainA.com as domain anyway, which is not what I expect since its not marked as default anymore.

However, if I wait some time and later create a group it works fine, the group will then correctly get DomainB.com.

Email Address Policies
I dont have any extra "Email Address Policies" added via Powershell etc, so think the group always should be created for the default domain.
https://docs.microsoft.com/en-us/microsoft-365/solutions/choose-domain-to-create-groups

Could this delay be a bug, or is it an expected behaviour?

azure-active-directorymicrosoft-graph-groups
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

michev avatar image
0 Votes"
michev answered Marcus commented

Changing the domain with the intent to provision a group there is not the approach you should be taking. Email address policies are the best solution here, or you can simply provision the group with specifying the -PrimarySMTPaddress value when using New-UnifiedGroup cmdlet.
If you want a completely Graph-based solution, you're out of luck as Graph does not allow you to change the primary SMTP address currently, as it has very limited support for Exchange operations.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The user should be able to choose via dropdownlist for which of the two domains the group should be created.
So in this case I dont think "Email address policies" will work good, because its up to the user to decide which domain to use.

However, I tried to create groups via powershell script as you suggested and yes the groups were created successfully and for correct domain each time I tested.

The application is a webapplication (.NET Core in Azure).. I guess I have to find a way to run powershell scripts from inside .NET Core webapp then.
Do you know if that is possible?

0 Votes 0 ·