Update MembersCanShare setting site
How to update the MembersCanShare setting of a SharePoint Online site collection (via the root Web) using a Power Automate flow.
URI
Headers
Body
Screenshot with example
Sample data
Site Address – https://contoso.sharepoint.com/sites/test
MembersCanShare – false
Copy/paste example
Resources
SP.Web MembersCanShare property
Set site sharing settings
That’s it, Happy testing!
Regarding the documentation,
_api/web
is for Sites, not SiteCollections. For SiteCollections it should be_api/site
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service?tabs=csom#construct-rest-urls-to-access-sharepoint-resources
Unfortunately, the Site class doesn’t have this property. So, it wouldn’t work on the ‘_api/site’ endpoint.
Only the Web class has this property: https://learn.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.client.web.memberscanshare?view=sharepoint-csom
That’s why I am using it on the (Root) Web of the Site Collection.
https://stackoverflow.com/questions/2549530/spweb-webs-site-vs-subsite