Forum Discussion
Oct 05, 2016
Changing the "Allow members to share" SharePoint site Access Requests setting using Office Dev PnP
How can I set the "Allow members to share the site and individual files and folders" setting using the Office Dev PnP Provisioning Engine or PowerShell commands? I haven't found this specific setting...
Andrew Hawkins
Oct 22, 2018Copper Contributor
I ran into this same problem. Try this:
$web = Get-PnPWeb -Includes MembersCanShare, AssociatedMemberGroup.AllowMembersEditMembership
$web.MembersCanShare=$false
$web.AssociatedMemberGroup.AllowMembersEditMembership=$false
$web.AssociatedMemberGroup.Update()
$web.RequestAccessEmail = $null
$web.Update()
$web.Context.ExecuteQuery()