PowerShell Script for Activate Publishing Feature for All Sites
$siteCollection = Get-SPSite $siteUrl
# iterate to all SPWeb (sub sites).
$siteCollection | Get-SPWeb -limit all | ForEach-Object{
write-host "Activating the PublishingWeb feature on " $_.Url
#Enable PublishingWeb Feature and the internal name of the SharePoint Server Publishing feature
Enable-SPFeature -Identity "PublishingWeb" -Url $_.Url
write-host "Activated the PublishingWeb feature on " $_.Url
}
$siteCollection.Dispose()
No comments:
Post a Comment