Forum Discussion
Add a security group as a member of a teamsite by flow.
Hi,
I am trying to find a solution to Add a security group as a member of a teamsite by flow.
When i create a new site i want to automatically ad a security group.
Tried to find something with 'send to HTTP' uri but can't find anything... anyone have an idea to solve this?
HoSFonnan To add security group to new SharePoint site, you first need to use the ensureUser endpoint which checks whether the specified login name (security group) belongs to a valid security group in the site. If the security group doesn't exist, adds the security group to the site.
Check first HTTP action given in my initial response. Provide display name of group to logonName property.
Then you can use the _api/web/siteusers endpoint to get security group Id from SharePoint user information list which you will use to grant permissions on site.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
HoSFonnan You can use HTTP request action and REST API to add user to SharePoint group. Follow below links for more information:
- https://www.codesharepoint.com/rest-api/add-user-to-site-group-in-sharepoint-using-rest-api
- https://stackoverflow.com/questions/68549333/not-able-to-add-user-to-sharepoint-group-using-rest-api
- https://sharepoint.stackexchange.com/questions/219150/add-a-user-to-sp-group-using-rest-api
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- HoSFonnanCopper ContributorThis is not the problem.
I want to add an existing security group automatically to a teams site.HoSFonnan Do you want to add security group inside a SharePoint group OR add security group directly under site permissions?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.