web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Graph API Request to F...
Power Automate
Answered

Graph API Request to Filter Active Members and Groups

(2) ShareShare
ReportReport
Posted on by 14,532 Super User 2026 Season 1
I need to make a call to the Graph API to get the members of a group with an active account and also return other groups within the group. I am using the following filter:
https://graph.microsoft.com/v1.0/groups/@{variables('Group ID')}/members?$count=true&$select=mail&$filter=endsWith(mail,'@mycompany.com') and accountEnabled eq true&$top=999
  • Note, the above query has ConsistencyLevel: eventual in the headers.
  • This works, but does not return any of the groups as it appears groups do not use the accountEnabled flag.
  • I searched the web and asked Copilot how to modify the query to include groups.
  • Copilot said to add or isOf('microsoft.graph.group') to the filter, but when I do it returns the error: "message": "Operator: 'IsOf' is not supported."
  • In this reference I cannot find anything related to filtering for groups: Advanced query capabilities on Microsoft Entra ID objects - Microsoft Graph | Microsoft Learn
Does anyone know how I can modify the query to include groups?
 
Thank you,
David
Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,846 Most Valuable Professional on at
    Afaik you can also use an $expand on members. That method does has some limitations but when you use an $expand it should also return details of the groups itself. Might be worth a shot?

    Btw, there are also a Transitivemembers method to retrieve users and groups of a group:
  • Suggested answer
    David_MA Profile Picture
    14,532 Super User 2026 Season 1 on at
    Thank you Expiscornovus. The link you provided helped. In the end, the only thing I needed to change to include the groups was to change the accountEnabled flag from equaling true to not equaling false.
     
    https://graph.microsoft.com/v1.0/groups/@{variables('Group ID')}/members?$count=true&$select=mail&$filter=endsWith(mail,'@mycompany.com') and accountEnabled ne false&$top=999
     This still requires you to set the following in the header of the API request:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard