Translate

Tuesday, August 12, 2014

List of all master pages for all web apps

Method 1
Get-SPWebApplication | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, URL, MasterUrl | Export-CSV C:\allmasterpage.csv

Method 2
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get All site collections
$SiteCollections = Get-SPWebApplication | Get-SPSite -Limit All
#Loop through all site collections
   foreach($Site in $SiteCollections)
    {
        #Loop throuh all Sub Sites
       foreach($Web in $Site.AllWebs)
       {
      $MasterPage = $Web.GetFile($Web.MasterUrl);
          $MasterPage.Name  +" : " +$Web.Url
       }
    }
     

No comments:

Post a Comment