Search code examples
odatamicrosoft-graph-api

How to query/filter from Microsoft Graph all groups where a user is owner


I would like to query from Microsoft Graph all groups where a specific user is owner. I tried the following query:
https://graph.microsoft.com/v1.0/groups?$filter=owners/any(owner: owner/id eq '4dc60fe7-8009-4131-a4e9-80dc5e86f98f')

Unfortunately this returns a 400.

Does anyone know the correct OData query? Or is this not even supported by MS Graph?


Solution

  • It's not possible to filter on owners. The documentation states which properties can be $filter'ed.

    Look for

    Supports $filter

    in the description of each property.

    You are going to have to read all groups, pull out their owners, and do the filtering client side.