简体   繁体   English

使用 Microsoft Graph API 列出包含团队的组时,过滤器不起作用

[英]filter is not working when using Microsoft Graph API to List Groups with Teams

I'm using Powershell, running multiple Graph API are fine.我正在使用 Powershell,运行多个图形 API 很好。 trying to get list of groups with teams by following below Doc:尝试通过以下文档获取包含团队的组列表:

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

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

the response is same like I didn't use the filter, still including all of groups which resourceProvisioningOptions is not 'Team', so it seems not working.响应与我没有使用过滤器一样,仍然包括所有 resourceProvisioningOptions 不是“团队”的组,所以它似乎不起作用。

$uri = "https://graph.microsoft.com/beta/groups"

is there any mistake when above $uri string combined?上面的 $uri 字符串组合有什么错误吗? on /Any(x:x eq 'Team') on /Any(x:x eq '团队')

Most likely your filter expression is ignored since PowerShell tries to expand $ into a variable.由于 PowerShell 尝试将$扩展为变量,因此很可能会忽略您的过滤器表达式。 A dollar sign needs to be escaped, in Powershell with "`" (backward apostrophe/grave) character:美元符号需要转义,在 Powershell 中带有“`”(后撇号/坟墓)字符:

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

Alternately use single quotes ' instead of double quotes " :交替使用单引号'而不是双引号"

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以使用 Microsoft Graph API 在 MS Teams 上的所有团队/组中搜索文件吗 - Can I search for a file through all the teams/groups I belong to on MS Teams using the Microsoft Graph API 使用 Microsoft 图形 API 时创建团队团队错误 - Create a teams team error when using Microsoft graph api 在 Microsoft Teams 中使用 Microsoft Graph API 列出私人团队频道成员 - List private team channel members with Microsoft Graph API in Microsoft Teams 使用 Microsoft Graph SDK for Java 时,如何为 Microsoft Teams API 指定许可查询参数? - How do I specify the licensing query parameter for the Microsoft Teams API when using the Microsoft Graph SDK for Java? Microsoft Teams Graph API - 列出外部聊天的成员时,无法获取姓名 - Microsoft Teams Graph API - When list members of an external chat, can not get name Microsoft Graph API:团队应用程序 - 使用“团队 ID”“列出频道成员”的问题 - Microsoft Graph API: Teams App - Problem with "List members of a channel" using "team id" 如何使用 Microsoft Graph Api 按 ID 筛选 SharePoint 列表项 - How to filter SharePoint list items by ID using Microsoft Graph Api 如何使用 Microsoft Graph API 获取 Teams 中的活动 PSTN 呼叫列表 - How to get a list of active PSTN calls in Teams using the Microsoft Graph API 使用 Microsoft Graph API 或 BOT API 发送 MS Teams 消息 - Sending an MS Teams message using the Microsoft Graph API or BOT API 使用 v1.0 团队图 API 创建 Microsoft Teams 团队时获取频道名称不能为空 - Getting channel name must not be empty when creating Microsoft Teams team using the v1.0 teams Graph API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM