Freigeben über


Turning off Access Requests in all sites in a web app

My customer uses Jive instead of Yammer for internal social media. Jive is housed in SharePoint 2013 on premises.

The question came up of how to turn off access requests to Jive sites because they are not needed. The customer wanted all checkboxes in this widget turned off on all sites in the web app Jive is using:

I quick internet search turned up this, which had a nice script to do just that - https://social.technet.microsoft.com/Forums/en-US/63841325-c643-42a2-baa8-2ba730575356/disable-manage-access-request-for-all-sites?forum=sharepointgeneralprevious

This script was created by @zeemanj.

 Add-PSSnapin Microsoft.SharePoint.PowerShell
$webApp = Get-SPWebApplication https://sharepoint/
foreach ($site in $webApp.Sites)
{
    Write-Host "Opening" $site.Url
 foreach ($web in $site.AllWebs)
   {
        Write-Host "Opening" $web.Url        
        if ($web.RequestAccessEmail -ne "")
        {                        
            $web.AddProperty("RequestAccessEnabledBackup", $web.RequestAccessEmail)
            $web.RequestAccessEmail = ""
            $web.Update()
            Write-Host $web.GetProperty("RequestAccessEnabledBackup") "saved"
        }
       $web.Dispose()
   }
    $site.Dispose()
}