Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Use PowerShell to find out ASPX pages which have been modified by SharePoint Designer.

$
0
0

Hi,

I have been tasked to find out all the pages in our sharepoint farm which have been modified by SPDesigner.

I am able to do this by multiple approaches and each approach results in a drastically different output. I want to know which is the most suitable one for my requirement.

1. Approach 1

foreach($w in $webList) {
    $files = $w.Files
    foreach($file in $files) {
       if ($file.CustomizedPageStatus.ToString() -eq "Customized") {
          $count = $count + 1
       }
    } 
}

This approach reports very very few pages. Though some blogs on the internet claim to use this... in my case I am pretty sure that this is skipping almost 99% of actual aspx pages

2. Approach 2

foreach($web in $webList) {
   $files = $web.Folders | %{$_.Files}
   foreach($file in $files) {
       If ($file.CustomizedPageStatus.ToString() -eq "Customized") {
           $count += 1
      }
   }
}


Much better than Approach 1... but I can still see that many ASPX pages are not reported.

3. Approach 3

For each($web in $webList) {
    $files = $web.GetListsOfType(SPBaseType.DocumentLibrary) | %{$_.Items} | %{$_.File}
    For each($file in $fileList) {
         If ($file.CustomizedPageStatus -eq "Customized") {
            $count += 1
         }
    }

Approach 3 returns me very high number of aspx pages. (Almost 80K+) funny thing is that CustomizedPageStatus is NONE for almost all entries I can clearly see that these pages are custom aspx pages (blogs, wiki, etch)... but everything has NONE as customizedpagestatus.

So at the end of the day I am not able to meet my end goal of finding out all the "hive pages" which were "unghosted" by people by editing with SPDesigner.

I am not interested in blogs, wiki type of ASPX.


val it: unit=()


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>