Add-PsSnapin Microsoft.SharePoint.PowerShell
## SharePoint DLL
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$webApplicationURL = "webApplicationURL"
$webApp = Get-SPWebApplication $webApplicationURL
$featurefolder = "FollowingContent"
if($webApp -ne $null)
{
foreach($site in $webApp.Sites)
{
if($site -ne $null)
{
foreach($subWeb in $site.AllWebs)
{
if($subWeb -ne $null)
{
Try
{
Disable-SPFeature -identity $featurefolder -Confirm:$false –URL $subWeb.url -ErrorAction Stop
Write-Output $subWeb " : Following Content Feature is Deactivated"
}
Catch
{
Write-Output $subWeb " : already Deactivated"
}
$subWeb.Dispose()
}
}
$site.Dispose()
}}}
Remove-PsSnapin Microsoft.SharePoint.PowerShell
No comments:
Post a Comment