无法在 Graph 中搜索网站

Cannot search for sites in Graph

我尝试通过名称或显示名称在 MS Teams 中查询团队。
searchfilter 似乎都不起作用:
(当前使用 HttpClient GET 请求)

首先,我可以查询所有站点
https://graph.microsoft.com/v1.0/sites

和 $select 像这样工作很好
https://graph.microsoft.com/v1.0/sites?$select=sharepointIds,name,displayname

但是这些都失败了:

https://graph.microsoft.com/v1.0/sites?$search="displayName:IT-Team"
https://graph.microsoft.com/v1.0/sites?$search=(displayName eq "IT-Team")
=空结果(也适用于 'name' 的其他尝试)
(使用 ' 时出现 BadRequest)

https://graph.microsoft.com/v1.0/sites?$filter=startsWith(name,'IT')
https://graph.microsoft.com/v1.0/sites?$filter=displayName eq 'IT-Team'
= BadRequest(它适用于用户和组)

空结果如下所示:
{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#sites","value":[]}

“搜索”应该适用于以下网站:
https://docs.microsoft.com/en-us/graph/api/site-search?view=graph-rest-1.0&tabs=http

如何通过 name/displayName 获取网站? 我不想查询 所有 站点只是为了获得 SiteId。

调用 https://graph.microsoft.com/v1.0/sites?search="IT-Team"site 资源的 displayNamedescription 字段中搜索搜索词和 returns 匹配站点。我意识到这不完全是您要查找的内容(您想查找网站,其中 displayName 等于您的搜索词),但它可能对您或其他人仍然有帮助。