question

LaurenAWeisenfluh-1577 avatar image
0 Votes"
LaurenAWeisenfluh-1577 asked LaurenAWeisenfluh-1577 answered

How can I get SharePoint site group members using Graph API?

I am trying to obtain all members of a SharePoint Site security group via Microsoft Graph API. I've been able to access our site's User Information List and locate the specific SP security group in the User Information List. However, I cannot expand the item to see who is in the SharePoint Site security group. How can I obtain SP site group members using Graph API? Is it possible to expand that item from the User Information List? Any insight is welcome! Thank you.

proc http url="https://graph.microsoft.com/v1.0/sites/root/lists/{User Information List ID}/items/{item ID, 5831 in this example}?expand=fields"
oauth_bearer="&access_token"
out=items;
run;


[1]: /answers/storage/attachments/87152-2021-04-12-15-51-28.png

microsoft-graph-security
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LaurenAWeisenfluh-1577 avatar image
0 Votes"
LaurenAWeisenfluh-1577 answered

Hi there, I ended up setting up a flow in Power Automate to pull the SP security group and populate a SP list with the member IDs (see URL below). Then you can use SAS via Microsoft Graph API to retrieve the member IDs from the list. Hope that helps!

https://www.c-sharpcorner.com/article/how-to-get-users-from-a-sharepoint-group-in-ms-flow/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered LaurenAWeisenfluh-1577 commented

Have a look at list group members for M365 or Security group members.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the thought! Unfortunately, I don't think SharePoint security groups are considered 'groups' in Microsoft Graph API (see https://docs.microsoft.com/en-us/answers/questions/135386/how-to-get-sharepoint-site-group-name-using-graph.html). I've been able to use that method for retrieving O365 distribution list groups, but not SharePoint security groups.

0 Votes 0 ·
NewtonSandeyOliveiraReis-0130 avatar image
0 Votes"
NewtonSandeyOliveiraReis-0130 answered NewtonSandeyOliveiraReis-0130 published

@LaurenAWeisenfluh-1577 do you managed to get a solution?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.