Sharepoint - Disable Share and Follow button
This script goes through the hierarchy and disables the Following Content feature in every WebSite. You get an error message for every site where the feature is not active or missing. This can be ignored
$w = Get-SPWeb http://MySharePointURL | ForEach{ $_.URL }
Get-SPFeature -Web $w |%{ Disable-SPFeature -Identity "FollowingContent" -URL $w -Confirm:$false}
This script disables the “Allow access request” setting under Site Settings -> Site Permissions -> Allow access request for all Sites and SubSites und the configured URL
$Webapp = Get-SPWebApplication "http://MySharePointURL"
ForEach ($site in $webapp.Sites)
{ForEach ($web in $site.AllWebs | where {$_.RequestAccessEnabled -and $_.Permissions.Inherited -eq $false})
{$web.RequestAccessEmail=""
write-host $web.Title, $web.URL updated}}
Source: Deactivate social feature MySite, Newsfeed, OneDrive, Sync, Share & Follow in SharePoint 2013