About the Teams API filter with resourceProvisioningOptions, seems not working

New Contributor

Need to get all list of Teams via Graph API,

https://docs.microsoft.com/en-us/graph/teams-list-all-teams?context=graph%2Fapi%2F1.0&view=graph-res...

 

I get the example of the filter to get groups with teams.

 

GET /groups?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')

 

 

Could anyone help to explain the above "/Any(x:x eq 'Team')"?

 

After using above example filter, I found the response is same like I didn't use the filter, still including all of groups which resourceProvisioningOptions are not 'Team',

so the filter seems to be not working.

 

below is my code looks like:

 

$uri = "https://graph.microsoft.com/beta/groups?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')" $groups = GetGraphData($uri,$headerParams)

 

 

1 Reply

It works fine here, make sure you're using the /beta endpoint though. Also, if running this against PowerShell or similar, make sure to escape all the relevant special chars ($ for example).

 

The other possibility is that all your M365 groups are team-enabled, in which case you will indeed get the same results with or without the filter :)

www.000webhost.com