About the Teams API filter with resourceProvisioningOptions, seems not working

%3CLINGO-SUB%20id%3D%22lingo-sub-1557672%22%20slang%3D%22en-US%22%3EAbout%20the%20Teams%20API%20filter%20with%20resourceProvisioningOptions%2C%20seems%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1557672%22%20slang%3D%22en-US%22%3E%3CP%3ENeed%20to%20get%20all%20list%20of%20Teams%20via%20Graph%20API%2C%3C%2FP%3E%3CP%3E%3CFONT%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fteams-list-all-teams%3Fcontext%3Dgraph%252Fapi%252F1.0%26amp%3Bview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fteams-list-all-teams%3Fcontext%3Dgraph%252Fapi%252F1.0%26amp%3Bview%3Dgraph-rest-1.0%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20get%20the%20example%20of%20the%20filter%20to%20get%20groups%20with%20teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EGET%20%2Fgroups%3F%24filter%3DresourceProvisioningOptions%2FAny(x%3Ax%20eq%20'Team')%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3ECould%20anyone%20help%20to%20explain%20the%20above%20%22%3CFONT%3E%2FAny(x%3Ax%20eq%20'Team')%3C%2FFONT%3E%22%3F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20using%20above%20example%20filter%2C%20I%20found%20%3CSPAN%3Ethe%20response%20is%20same%20like%20I%20didn't%20use%20the%20filter%2C%20still%20including%20all%20of%20groups%20which%20resourceProvisioningOptions%20are%20not%20'Team'%2C%3C%2FSPAN%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%3Eso%20the%20filter%20seems%20to%20be%20not%20working.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebelow%20is%20my%20code%20looks%20like%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%24uri%20%3D%20%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fgroups%3F%24filter%3DresourceProvisioningOptions%2FAny(x%3Ax%20eq%20'Team')%22%20%24groups%20%3D%20GetGraphData(%24uri%2C%24headerParams)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1557672%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGraph%20API%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1557971%22%20slang%3D%22en-US%22%3ERe%3A%20About%20the%20Teams%20API%20filter%20with%20resourceProvisioningOptions%2C%20seems%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1557971%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20works%20fine%20here%2C%20make%20sure%20you're%20using%20the%20%2Fbeta%20endpoint%20though.%20Also%2C%20if%20running%20this%20against%20PowerShell%20or%20similar%2C%20make%20sure%20to%20escape%20all%20the%20relevant%20special%20chars%20(%24%20for%20example).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20other%20possibility%20is%20that%20all%20your%20M365%20groups%20are%20team-enabled%2C%20in%20which%20case%20you%20will%20indeed%20get%20the%20same%20results%20with%20or%20without%20the%20filter%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted

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 :)