3

I have created user group Group-1 in SharePoint Online Site. I have added few members in Group-1.

Now, I have created a group Group-2 in Office 365 and added few members in the Group-2. Now I have added this Group-2 in SharePoint Site.

Now when I am trying to get the Groups and Members of SharePoint Site then I am getting only Groups created in SharePoint, but I am not getting the group created in Office 365 and associated in SharePoint.

Note: I am able to see that Group-2 in SharePoint using GUI but not members.

Question:

How can I get the Group-2 and its Members in SharePoint programmatically?

Let me know if there is need of more details.

3 Answers 3

1

you can get the user from that specific group using rest api as below.

http://sitename/_api/web/sitegroups/getbyname('Owners')/users

More at enter link description here

4
  • I really appreciate your answer, But the problem is, I am not able to get the Group-2 in all group list while I use this rest api call https://SITEURL/_api/web/sitegroups. Here I am getting only Group-1 which is created in SharePoint Online. Dec 19, 2017 at 10:05
  • How you added the Office 365 user group in sharepoint site? in any group or you grant the permission to that group?
    – Ramesh
    Dec 19, 2017 at 10:43
  • I just simply clicked on Share link on the top of the site and added Group-2 there Dec 19, 2017 at 11:05
  • Please check the answer below..
    – Ramesh
    Dec 19, 2017 at 11:25
1

Did you create an O365 group in Office 365 Admin Center directly? If yes, you need to add members to the Group-2 in SharePoint site manually.

0
0

enter image description here

In That case it should added to any other group as a member. as in given screen shot I have shared site with "Test Group" which is office 365 group and it is added to Member Group of sharepoint site group.

Your Answer

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

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