SharePoint Tech Blog


Enumerate SharePoint features using Powershell

Filed under: PowerShell, SharePoint — Tags: , — kctnpblog @ 8:42 pm

This code requires the SharePoint Powershell Profile to be loaded.

To execute the code, provide the site url as a command line parameter.
e.g. powershell .\listfeatures.ps1 http://site

The output lists the features on the web application, site collection and web.

function writefeature($featureobj) {
"{0,-40} {1,-50} {2,-40}" -f $feature.Id , $feature.DisplayName , $feature.Scope;

function setwindowsize() {
$pshost = get-host
$pswindow = $pshost.ui.rawui

$newsize = $pswindow.buffersize
$newsize.height = 3000
$newsize.width = 150
$pswindow.buffersize = $newsize


#Sets the size of the window to display well formatted output

#Get command line parameter for url

$farm = Get-SPFarm;

"Web application features"
$webapp = Get-SPWebApp $url;
$webapp.Features | ForEach-Object {
writefeature $_;

"Site collection features"
$spsite=Get-SPSite -url $url;
$spsite.Features | ForEach-Object {
writefeature $_;

"Web features"
$spweb=Get-SPWeb -url $url;
$spweb.Features | ForEach-Object {
writefeature $_;


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: