Forum Discussion
Add a security group as a member of a teamsite by flow.
- Sep 26, 2022
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.
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.
- HoSFonnanSep 22, 2022Copper ContributorSorry for not being clear ^^
I want to add securrity group under site permissions- ganeshsanapSep 22, 2022MVP
HoSFonnan Use flow like this:
This grant contribute access to security groups. You can find other roledefid values in my answer at: SP REST - add an existing group to site with 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.
- HoSFonnanSep 26, 2022Copper Contributor
ganeshsanap Hi,
But i cant add an existing domain/security group with this flow?I want to add this group automatic when you create a new site.
After I test run your example flow i get this result: