1

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?

4
  • does below solution help you in any way? Commented Aug 1, 2023 at 8:08
  • I tried this solution ,but it didn't worked for me.
    – Renuka
    Commented Aug 1, 2023 at 8:10
  • Are you facing any issue while using it? Commented Aug 1, 2023 at 8:25
  • thank you so much for helping me, when I tried this solution , it shows an error 'Page Not Found' . Then I did it by adding all group names in a list. After that I didn't work on this solution.
    – Renuka
    Commented Aug 1, 2023 at 9:30

1 Answer 1

0

You have to use the Microsoft Graph APIs to get the details of Mail-enabled security groups.

For example:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.