I want to show Mail-Enable security Group Names in select tag.
Can someone please tell how can I get the group names using SPFx react?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
You have to use the Microsoft Graph APIs to get the details of Mail-enabled security groups.
You can use the query endpoint like below:
https://graph.microsoft.com/v1.0/groups?$filter=mailEnabled eq true and securityEnabled eq true
Documentation: Working with groups in Microsoft Graph
Also, check this documentation: Consume the Microsoft Graph in the SharePoint Framework
This may return mail enabled M365 groups as well. Usually M365 groups have 'Unified' value in
groupType property. So you can filter results based on this property in your code to exclude M365 groups from results array.
Similar thread (not worked for me): Query Mail Enabled Security group from Graph API .net SDK