【问题标题】:MS Graph: How To Distinguish Teams-Enabled M365 Groups Using GraphClient?MS Graph:如何使用 GraphClient 区分启用团队的 M365 组?
【发布时间】:2021-01-01 01:48:01
【问题描述】:
【问题讨论】:
标签:
c#
microsoft-graph-api
sharepoint-online
microsoft-graph-sdks
microsoft-graph-teams
【解决方案1】:
我想继续阅读 Baker_Kong 的有用帖子。
此功能在 beta 和 v1.0 端点中都可用。 v1.0 元数据(我们用来生成模型)中没有描述它,这就是您在对象模型中看不到它的原因。在解决此问题之前,您可以使用 beta 客户端或:
// 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发帖
【解决方案2】:
@特蕾西,
我在控制台应用程序中测试了 SDK,我相信此属性位于组实体下:
或者您可以添加select 选项以省略返回的属性:
graphClient.Groups.Request().Select("id,resourceProvisioningOptions").GetAsync().Result;
BR