I have this CSOM in my PowerShell script:

$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName,$password)
$Ctx.Credentials = $SPOCredentials

$web = $ctx.web
$web.RequestAccessEmail = ""
$web.MembersCanShare = $true;
$web.AssociatedMemberGroup.AllowMembersEditMembership = $false;

However, despite executing without errors and successfully disabling access requests, I end up with allowing site members to be added and sharing of files and folders disabled. It should be the opposite, as below.

Can anyone help please?


Access Request settings

  • Anyone please? Interestingly, I tried swapping $true and $false but the end result is the same. But removing the lines altogether leaves both boxes ticked. It just doesn't add up. Thanks – Tom Urwin May 22 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.