cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mousman85
Helper III
Helper III

Add specific o365 group to a SharePoint Site Permission Group

Hi,

 

I'm trying to set a flow that will create a hubsite, after the site is created, it will add a specific 365 group to the site a visitor, this group contains all our employees and gives them visitor access to every hubsite that is created (we are creating a hubsite per client and need all employee's to have access). 

 

I have the flow working with all aspects apart from being able to add a a group. I can add a specific user as a visitor that work fine. The group itself is a cloud created o365 group and the name will never change it will just be used to manage access across all the sites. I know this needs to be done with a HTTP request but i cannot work out what the body code should be to add a group and not a user. Any advice would be brilliant.


Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mousman85
Helper III
Helper III

I managed to solve this using the below as the setting for the Send HTTP request to sharepoint. 

Method - POST

URI - /_api/web/sitegroups(4)/users (this adds groups to the visitors sharepoint permission group)

Headers: 
accpet = application/json;odata.metadata=none
content-type = application/json;odata=verbose
{ '__metadata': { 'type': 'SP.User' }, 'LoginName': 'c:0t.c|tenant|<Group OBJECT ID>'}

 

I got the Group Object ID from Azure AD, this works for any group as long it doesn't have a another group assigned to it, so it is all users, i am using an on prem created Security Group as we wanted to only have to manage one group for giving access to all our Client Hubsites. 

 

I wanted my group added as visitors to each site that is created through Automate, so used the sitegroups(4) this seems to always be Visitors permission group for each newly created site, you can get the sitegroups number by going to Site Settings/Site Permissions - click the group you want to know the ID for and it will show the URL bar. 

 

hope this helps someone else.

View solution in original post

2 REPLIES 2
mousman85
Helper III
Helper III

I managed to solve this using the below as the setting for the Send HTTP request to sharepoint. 

Method - POST

URI - /_api/web/sitegroups(4)/users (this adds groups to the visitors sharepoint permission group)

Headers: 
accpet = application/json;odata.metadata=none
content-type = application/json;odata=verbose
{ '__metadata': { 'type': 'SP.User' }, 'LoginName': 'c:0t.c|tenant|<Group OBJECT ID>'}

 

I got the Group Object ID from Azure AD, this works for any group as long it doesn't have a another group assigned to it, so it is all users, i am using an on prem created Security Group as we wanted to only have to manage one group for giving access to all our Client Hubsites. 

 

I wanted my group added as visitors to each site that is created through Automate, so used the sitegroups(4) this seems to always be Visitors permission group for each newly created site, you can get the sitegroups number by going to Site Settings/Site Permissions - click the group you want to know the ID for and it will show the URL bar. 

 

hope this helps someone else.

View solution in original post

Thank you for your detailed response.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (15,058)