Warm tip: This article is reproduced from serverfault.com, please click

MS Graph: How To Distinguish Teams-Enabled M365 Groups Using GraphClient?

发布于 2020-12-28 21:43:04

The MS Graph rest API surfaces a resourceProvisioningOptions attribute to indicate whether a MS365 group is also a Team (see below). However, those values do not appear to be available in the GraphServiceClient.

I found this post, and used the sites endpoint to get the associated SharePoint URL for an M365 group. But some M365 groups have SharePoint sites and are not Teams.

The only other option I found was to use the teams endpoint and catch the exception when no team is found for the group ID. But then I still have to do the additional sites endpoint query to get the SharePoint URL.

Does anyone know of another/better way to distinguish between Team/non-Team M365 groups when using the GraphServiceClient?

enter image description here

Questioner
Tracy
Viewed
0
Baker_Kong_MSFT 2020-12-29 10:24:15

@Tracy,

I have a test the SDK in a console app, I believe this property is under the group entity:

enter image description here

or you can add select option to omit the returned properties:

graphClient.Groups.Request().Select("id,resourceProvisioningOptions").GetAsync().Result;

BR