Azure AD B2C creates groups with the same name using the Graph API

Dmytro 81 Reputation points

Hello everyone!

I'm creating groups using the graphics API. I noticed that when creating groups, the graph does not check the group name for uniqueness and allows you to create several groups with the same name. Is there such a check when creating a group?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,900 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,686 questions
{count} votes

Accepted answer
  1. Olga Os - MSFT 5,836 Reputation points Microsoft Employee

    Hello @Dmytro ,

    Below some findings from my research:

    • You can register multiple applications/groups/etc with the same name in Azure AD, but those must have different IDs.
    • Group Creation: the displayName property isn't checked for uniqueness, unlike the mailNickname property. This is by design and not a bug. You can use the mailNickname property to enforce uniqueness.
      If you'd like to recommend it as a feature request, please post this at the Microsoft 365 Developer Platform ideas forum and other customers can amplify your voice.

    Reference: POST operation for group creates duplicate groups with same name

    Hope above answers your questions and concerns.


    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    Olga Os

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Dmytro 81 Reputation points

    Hello @Olga Os - MSFT !

    Thanks for your reply. It really cleared things up.
    This method works if I create an ms365 group and doesn't work if I create a security group. And I can't create a mail-enabled security group using the graph API !

    This looks strange. :)

    0 comments No comments

  2. CarlZhao-MSFT 38,031 Reputation points

    Hi @Dmytro ,

    Neither MS 365 groups nor security groups should allow multiple creation with the same display name. I noticed that creating MS365 groups/security groups in Azure AD UI is limited by display name, so this is more like an unknown issue with graph api, I suggest you submit user voice feedback this issue.

    As for your statement that mail-enabled security groups cannot be created using the graph API, this is by design, and there is currently no support for creating and managing mail-enabled security groups using the graph api.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  3. Olga Os - MSFT 5,836 Reputation points Microsoft Employee

    Hello @CarlZhao-MSFT ,

    Depending on the group type some parameters could require/not require to be unique. => check there

    As example, M365 doesn't require the displayName to be unique.

    or mandatory for unique name for Mail-Enabled Security

    mandatory for unique name for Distribution Group


    Olga Os

    0 comments No comments