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

I'm using Microsoft 365 and Teams. I need to check the rights of users in a team in MS Teams and i

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();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744942862a4602435.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信