On one of our Sharepoint 2010 site collection we would like to disable access requests on a few hundred sites, and looking for a client-side solution to do this. I understand that CSOM does not support this. I checked the Web Services documentation, and under "Permissions" I did not see any suitable method. Can this be found somewhere else, or do I really need to run a script like in powershell on the server?
1 Answer
I don't think you can do it on client side, but using powershell it is quite easy
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$WebAppURL = "http://your-web-app-url.com/"
#Get all sites
$WebsColl = Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | Get-SPWeb -Limit All
ForEach ($web in $WebsColl)
{
if($web.RequestAccessEnabled -and $web.Permissions.Inherited -eq $false)
{
#Disable access request
$web.RequestAccessEmail=""
$web.Update()
write-host "Access request disabled at site:"$web.URL
}
}