The more I work with SharePoint 2010 the more I am starting to love PowerShell. My scripting skills are pretty basic (!) but here are a couple of useful little snippets to get back some information from a site that previously I would have spent a while going through the UI or SharePoint Root – mainly as a reminder for myself!
List all installed features on the farm
It’s really straight forward using the Get-SPFeature command to return all installed features. To provide a little more readability to the output it can be sorted as follows:
By feature display name alphabetically,
Get-SPFeature | Sort -Property DisplayName
By feature ID,
Get-SPFeature | Sort -Property Id
By feature display name alphabetically and grouped by scope,
Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id
And to write this to a file to allow for viewing in Notepad, Excel etc,
Get-SPFeature | Sort -Property Scope,DisplayName | FT -GroupBy Scope DisplayName,Id > c:\AllInstalledFeatures.txt
List all activated site scoped features
Especially in the case of hidden features it’s sometimes necessary to track down if a feature is active on a site collection. Here’s a quick way of seeing which features are activated for an SPSite:
Get-SPFeature -Site http://sitecollectionurl | Sort DisplayName | FT DisplayName,Id
List all activated web scoped features
And only slightly modified from the Get-Help Get-SPFeature -examples text, here is a command to list all web activated featres for a site collection:
Get-SPSite http://sitecollectionurl | Get-SPWeb -Limit ALL | %{ Get-SPFeature -Web $_ } | Sort DisplayName -Unique | FT DisplayName,Id









[...] however both the enterprise wiki and the publishing portal prompted for authentication. I then used PowerShell to list the activated features and confirm that both of these sites had the site scoped ViewFormPagesLockDown feature enabled on [...]
excellent
Cheers Glynn, ive printed these out to stick on my wall. Another good resource is
http://www.techieshelp.com/powershell-commands-and-what-they-do/
i used this on a course as i never remeber the syntax. cheers!
No problem Tristian – glad you found it useful!
Hi,
Is there any way to get all sites where a specific feature is activated in the farm
Thanks
absolutely
Thanks you, that was really useful.
Do you know where i could find OfficeWebApps Feature ID ?
because I don’t have office web apps installed on my farm, so i cannot see the feature ID, since the commands only list the installed feature.
As well, do you know how to install office web apps ?
Thanks,
Regards,