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.
This is what i want:
Copy Domain and security groups from "site A" and use the same groups on "site B"
With your commands/code. It return the value of null. Because the group is not existing on the new site.
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.
- ganeshsanapSep 27, 2022MVP
HoSFonnan Yes, you can grant permissions to folder as well after you get the security group ID from SharePoint.
Starting Uri for folder permissions will be something like this:
_api/web/getFolderByServerRelativeUrl('/sites/dev/doc1/Folder1')/ListItemAllFields/RoleAssignmentsPlease consider giving a Like if my post helped you in any way.
- HoSFonnanSep 27, 2022Copper Contributor
- HoSFonnanSep 26, 2022Copper ContributorThank you for the help!
It works now!