Microsoft Graph API to check if a group exists in Azure AD

MS Techie 2,681 Reputation points
2021-11-14T10:08:36.777+00:00

Is there any Microsoft REST API to check if a specific SECURITY GROUP exists in Azure AD.

For Example , if i want to check a group "ABCD_Group" exists in Azure AD, what is the Microsoft Graph API for it ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,365 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 27,711 Reputation points Microsoft Employee
    2021-11-17T11:46:00.857+00:00

    Hi @MS Techie – It seems there is no such direct API to check group existence in Azure AD.

    You can try to retrieve Security Group using

    https://graph.microsoft.com/v1.0/groups?$filter=securityEnabled eq true

    And then check for each group display name with your group name weather it exists or not in Azure AD as below
    if(group.DisplayName.equals("ABCD_Group"))

    Hope this will help you to get what you are looking for.

    0 comments No comments