最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

microsoft graph api - How to determine associated Sharepoint site collections of a teamgroup? - Stack Overflow

programmeradmin1浏览0评论

I'm using Microsoft 365 and Teams. I need to check the rights of users in a team in MS Teams and in addition given access to files / folders within the folder structure as well.

My first approach was to use the graph sdk. I can access the group and associated team using:

var groups = await graphClient.Groups.GetAsync(x =>
    {
        x.QueryParameters.Filter = "displayName eq 'MyTeam'";
    });
var group = groups.First();
var team = await graphClient.Groups[group.Id].Team.GetAsync();

Now I want to determine the site collection and to access it as well to check the members and user rights there.

I used

var associatedSites = await graphClient.Groups[group.Id].Sites.GetAsync();

but I get all sites and not just those of the team.

So how can I get access to the associated site collection and the associated folder structure to check the members and their rights.

I'm using Microsoft 365 and Teams. I need to check the rights of users in a team in MS Teams and in addition given access to files / folders within the folder structure as well.

My first approach was to use the graph sdk. I can access the group and associated team using:

var groups = await graphClient.Groups.GetAsync(x =>
    {
        x.QueryParameters.Filter = "displayName eq 'MyTeam'";
    });
var group = groups.First();
var team = await graphClient.Groups[group.Id].Team.GetAsync();

Now I want to determine the site collection and to access it as well to check the members and user rights there.

I used

var associatedSites = await graphClient.Groups[group.Id].Sites.GetAsync();

but I get all sites and not just those of the team.

So how can I get access to the associated site collection and the associated folder structure to check the members and their rights.

Share Improve this question asked Mar 7 at 8:01 Martin H.Martin H. 1,1081 gold badge17 silver badges30 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

The graph api has this endpoint GET /groups/{group-id}/sites/root. See in the api reference.

So this should work:

var site = await graphClient.Groups[groupId].Sites["root"].GetAsync();
发布评论

评论列表(0)

  1. 暂无评论