gpt4 book ai didi

c# - MS图: How To Distinguish Teams-Enabled M365 Groups Using GraphClient?

转载 作者:行者123 更新时间:2023-12-02 19:01:39 25 4
gpt4 key购买 nike

MS Graph REST API 呈现 resourceProvisioningOptions 属性来指示 MS365 组是否也是团队(见下文)。然而,这些值 do not appear可在 GraphServiceClient 中找到.

我找到了this post ,并使用 sites endpoint获取 M365 组的关联 SharePoint URL。但某些 M365 组拥有 SharePoint 网站,而不是 Teams。

我发现的唯一其他选项是使用 teams endpoint并在没有找到该组 ID 的团队时捕获异常。但随后我仍然需要执行其他站点端点查询来获取 SharePoint URL。

有人知道使用 GraphServiceClient 时区分团队/非团队 M365 组的另一种/更好的方法吗?

enter image description here

最佳答案

我想继续阅读 Baker_Kong 的有用帖子。

此功能在 beta 和 v1.0 端点中均可用。它在 v1.0 元数据(我们用来生成模型)中没有描述,这就是为什么您在对象模型中看不到它。在此问题解决之前,您可以使用测试版客户端或:

// Get only groups that have teams.
var groupsThatHaveTeams = await client.Groups.Request().Filter("resourceProvisioningOptions/Any(x:x eq 'Team')").GetAsync()

// When the metadata is fixed, each group will have a ResourceProvisioningOptions property that you can inspect for the 'Team' value.
// Until then, you'd need to look at the Group.AdditionalData dictionary for the resourceProvisioningOptions key and check if it has the 'Team' value.
var groupsThatMayHaveTeams = await client.Groups.Request().Select("id,resourceProvisioningOptions").GetAsync();

交叉发布自 https://github.com/microsoftgraph/msgraph-sdk-serviceissues/issues/44#issuecomment-752775347

关于c# - MS图: How To Distinguish Teams-Enabled M365 Groups Using GraphClient?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65484476/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com