Microsoft 365 : SharePoint Online – Get the Group Membership ID from UI / Fetching all the users of SharePoint group using REST API

Microsoft 365 - REST API to fetch all the users of the the respective group
Microsoft 365 - REST API to fetch all the users of the the respective group

Hi All,

Greetings for the day!!!

Today just small post for reference since it is required in multiple posts

In this article we will discuss how to get / know / identify Group Membership ID and REST API to get users from the respective group

Background :

  • In one of our project we need to get all the users who are members of SharePoint group
  • We will be using REST API to get all the users who belongs to respective group – _api/web/sitegroups(6882)/users

Microsoft 365 - REST API to fetch all the users of the the respective group
fig : Microsoft 365 – REST API to fetch all the users of the the respective group

  • Here as in above REST api sitegroups contains the parameter – Group Membership IDsitegroups(<Group Membership ID>)

Steps to get the Group Membership ID from UI

  • SharePoint groups scope is at site collection level
  • Navigate to SharePoint site collection from where group is created
  • Once we are on SharePoint site collection – we need to navigate to Site Permissions page (_layouts/15/user.aspx)
  • From site gear icon (right top corner) navigate to “Site Permissions” option

Microsoft 365 - Navigating to "Site permissions" page
fig : Microsoft 365 – Navigating to “Site permissions” page

  • On click of “Site permissions” link, right pane / blade / dialog – “Permissions” will open as shown in below fig

Microsoft 365 - Navigating to "Site permissions" page
fig : Microsoft 365 – Navigating to “Site permissions” page
  • From “Permissions” pane, click on “Advanced permissions settings” link from the bottom.
  • We will be redirecting to “_layouts/15/user.aspx

Microsoft 365 - "Site permissions" page
fig : Microsoft 365 – “Site permissions” page

  • Site permission” pages enlists the list of groups and users with respective permissions as shown in above fig
  • Click on the group of which we need to see the Membership Group ID
  • Here as in above figure, I’ll click on “Knowledge Junction” group
  • We will be redirecting to the given group – people.aspx page (_layouts/15/people.aspx) along with Membership Group ID
  • Please notice in address bar we will get the value – Membership Group ID for the selected group as shown in below fig
  • MembershipGroupId is querystring parameter for people.aspx page

Microsoft 365 - People.aspx page - Membership Group ID as a querystring parameter
fig : Microsoft 365 – People.aspx page – Membership Group ID as a querystring parameter

Thanks for reading the article !!! Please feel free to discuss in case any issues / suggestions / thoughts / questions

HAVE A GREAT TIME AHEAD !!!

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

1 Response

  1. July 13, 2022

    […] We have a separate article to get / know the Group Membership ID, please have a look – Microsoft 365 : SharePoint Online – Get the Group Membership ID from UI / Fetching all the users o… […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: