Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top