Forum Discussion
Steve Johnson
Sep 02, 2018Copper Contributor
Allow access request setting
Hey all, Is there a way to disable the Allow access request setting? I’ve had a try using the null $web.RequestAccessEmail approach, but the option is still enabled with the Site Owners group se...
- Sep 03, 2018
Hi Steve Johnson, try this (works in my tenancy):
Connect-PnPOnline -Url <site collection url>
$web = Get-PnPWeb
$web.RequestAccessEmail = ""
$web.Update()
Invoke-PnPQuery
Steve Johnson
Sep 03, 2018Copper Contributor
Thanks guys! Sorry Matt Weston, I should've specified that I have a whole bunch of Site Collections affected and it's causing confusion for users, so I'm looking at switching it off and adjusting our provisioning solution as appropriate too.
Oliver Zeiser Thanks, I've tried what you've suggested, but the Allow access requests box is refusing to uncheck.
This is the code I'm running - am I missing anything do you know?
$web = Get-PnPWeb -Includes MembersCanShare, AssociatedMemberGroup.AllowMembersEditMembership
$web.MembersCanShare=$false
$web.AssociatedMemberGroup.AllowMembersEditMembership=$false
$web.RequestAccessEmail=""
$web.AssociatedMemberGroup.Update()
$web.Update()
$web.Context.ExecuteQuery()
Write-Host "Access request settings updated"