Set the domain part of groups in the mailadrress (upon create or with update)

Set the domain part of groups in the mailadrress (upon create or with update)



 Aug 31 2021

We are creating a lot of groups through the Graph API, this works perfectly, but we can only specify the mailNickname meaning it will pick the default domain configured for that tenant. Since we are using application permissions we cannot use the Microsoft 365 groups naming policies. and we don't know if they would even be considered when using the Graph API.


In one sentence we would like to be able to set the used domain upon group creation, or have a way to change the domain for existing groups. The way this works with users seems reasonable.


Being able to group groups in a specific domain seems like a reasonable request, especially if tenants grow larger.


We tried the following actions:

  1. Just send an update with the mail property (ignoring the fact that the mail property is read-only as stated here. (fails with bad request)
  2. Add the mail property to the create request. (fails with bad request)
  3. Extracting a token from the browser and mimicking the same calls as the admin portal does (works, but we don't want to rely on internal api's that might change soon) 

At the moment we have 2 ways of achieving what we need "create groups with a domain different from the default":

  • Change the default domain right before the group creation (highly likely to fail, but works)
  • Request application access to the entire Exchange environment, and run a powershell to change the groups (we don't want access to all users emails just to change a domain on groups, and we also don't want to implement some powershell script to a different service just to change domains). 

@BrianTJackett suggested us to create a feature request here after a callout on twitter