Get-SPSite -Limit All| Where-Object {(Get-SPFeature "PublishingSite" -ErrorAction SilentlyContinue -Site $_.Url) -ne $null } | Select Url
So the format is
Get-SPSite -Limit All | Where-Object { (Get-SPFeature <Feature Name> -ErrorAction SilentlyContinue -Site $_.Url) -ne $null } | Select Url
Note that it will only check for site collection scoped features. The above Powershell can be modified for web scoped features as below.
Get-SPSite -Limit All| Get-SPWeb -Limit All | Where-Object { (Get-SPFeature <Feature Name> -ErrorAction SilentlyContinue -Web $_.Url) -ne $null } | Select Url
e.g. To check Publishing feature activation status at web scope, it will look like as below. "PublishingWeb" is a web scoped feature.
Get-SPSite -Limit All| Get-SPWeb -Limit All | Where-Object { (Get-SPFeature "PublishingWeb" -ErrorAction SilentlyContinue -Web $_.Url) -ne $null } | Select Url
This powershell block can be extended for web application/Farm scoped features also.
1 comment:
great post sir.. keep it up.
Post a Comment