Pages

Tuesday 11 June 2013

How to get a list of all activated features for a site collection and a sub site in SharePoint 2010 using powershell

To get a list of Site collection features:

Get-SPSite http://sharepoint2010 | % {

    $results = @()

    Get-SPFeature -Site $_ -Limit All | % {

    $feature = $_; 
        $featuresDefn = (Get-SPFarm).FeatureDefinitions[$_.ID]; 
        $cc = [System.Globalization.CultureInfo]::CurrentCulture;

        $obj = New-Object PSObject;
        $obj | Add-Member NoteProperty  Title  $($featuresDefn.GetTitle($cc));
        $obj | Add-Member NoteProperty  Hidden $($feature.Hidden);
        
        $results += $obj;
    }
    $results | FT -auto;
}
 
 
To get a list of features for a sub site:
 
Get-SPWeb http://sharepoint2010/subsite | % {

    $results = @()

    Get-SPFeature -Web $_ -Limit All | % {

        $feature = $_; 
        $featuresDefn = (Get-SPFarm).FeatureDefinitions[$_.ID]; 
        $cc = [System.Globalization.CultureInfo]::CurrentCulture;

        $obj = New-Object PSObject;
        $obj | Add-Member NoteProperty  Title  $($featuresDefn.GetTitle($cc));
        $obj | Add-Member NoteProperty  Hidden $($feature.Hidden);
        
        $results += $obj;
    }
    $results | FT -Auto;
} 


Shows both hidden and non-hidden features
 
Thanks to  Joe Rodgers (blogs.msdn.com/b/josrod/archive/2013/01/04/
powershell-to-list-activated-features-for-a-site-and-web.aspx)

Permissions for all authenticated users was corrupted in a Classic mode web application sharepoint 2010

Recently I was working on a Form library which stopped inheriting permissions from the parent.

Issue:

"All authenticated users" were added to the form library, however none of the users were able to access this list.

Upon investigating further (by clicking on the user account), found out that for some reason the account was claims based, even though the web application was classic mode;

This is what was displayed:
Account: (c:0(.s|true) 
Name: All Authenticated Users

Fix:

Deleted the account and re-added

Tuesday 4 June 2013

How to get the Folder structure tree view using MS DOS

When migrating content from a file system to a web based system, it is very help full to get a report on the file structure

Open command prompt

tree /a /f "directory path" > TreeReport.txt


/f Displays file names in each directory.
/a ext characters used for linking lines, instead of graphic characters. /a is used with code pages that do not support graphic characters and to send output to printers that do not properly interpret graphic characters.