1

I have a question regarding quering site groups via REST Graph API instead of SharePoint REST API. Currently I need to query SharePoint REST API to find implicit groups (*Visitors, *Members, *Owners) for each site in order to find users that are members of those groups (those groups are not present in groups Graph API). To achieve this I am using two queries. First:

https://{site_url}/sites/{ site name}/_api/Web/SiteGroups

to obtain list of implicit groups with type ids, and then:

https://{site_url}/sites/{ site name}/_api/Web/SiteGroups/GetById({id})/Users

to obtain list of users in one specific group obtained from first query.

So the question is: Are any equivalents to those two queries above in REST Graph API or I need still to obtain those information from SharePoint REST API?

3 Answers 3

2

Looking at the documentation for the Sites endpoint (both v1.0 and beta), it does not appear that you can get SharePoint Permission Groups or their members from the Graph.

https://docs.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-1.0

https://docs.microsoft.com/en-us/graph/api/resources/site?view=graph-rest-beta

0

It seems that now Owners and Members can be accessed via the Graph API. See this post.

Site groups now appear under https://graph.microsoft.com/v1.0/groups/, and you can access owners and members with

respectively

However, I still do not see a way to access visitors

Alternatively, per this post, it seems that you can query a site's User Information List, and then see the ContentType: Person results to find who it has been shared with.

-1

As per my understanding currently Microsoft Graph does not support working with SharePoint groups and we can only work with Sites, Lists and ListItems using Microsoft Graph (correct me if I am wrong).

Source: Working with SharePoint sites in Microsoft Graph.

Workaround:

  1. Go with traditional SharePoint REST APIs as you are already using.
  2. Use PnPJS library to get SharePoint Site groups and Group members easily.

References: @pnp/sp/site-groups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.