List the webparts from each page   

Tags: SharePoint 2010, PowerShell, General
Technorati Tags: , ,

I got an e-mail of one my colleagues if anyone had a PowerShell script to list the webparts installed on a page.

So I wrote a simple script that will list the webparts installed on a page.

 

PowerShell script:

 

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
 
$s = Get-SPSite "Your url"
 
foreach($w in $s.AllWebs){
    
    $l = $w.Lists["Pages"];
    
    foreach($i in $l.items){
    
        $f = $i.file
        
        $url =  [string]::Concat($w.Url ,"/" ,$f.url)
    Write-Host -ForegroundColor Blue $url
        
    $wpm =     $w.GetLimitedWebPartManager($f.url,[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
    
    foreach($wp in $wpm.WebParts)
    {    
        
        Write-Host -ForegroundColor green $wp.Title;
    }
    Write-Host ""
         }
}
 
Posted by  Gilissen Timmy  on  9/26/2011
9  Comments  |  Trackback Url  | 0  Links to this post | Bookmark this post with:        
 

Links to this post

Comments


Carly  commented on  Tuesday, January 24, 2012  11:05 AM 
Great atricle but it didn't have everything-I didn't find the kitchen sink!


hqvlwea  commented on  Wednesday, January 25, 2012  9:49 AM 
YcEwpu <a href="http://rglzzaqiwwnx.com/">rglzzaqiwwnx</a>


qodyrxkw  commented on  Wednesday, January 25, 2012  1:43 PM 
HXsb6e , [url=http://njnhytuudanj.com/]njnhytuudanj[/url], [link=http://qlbomxfetokm.com/]qlbomxfetokm[/link], http://wwhzyecayrub.com/


chrissiejay  commented on  Sunday, January 29, 2012  12:11 PM 
generic provigil >:) zovirax 8-(( tamoxifen no prescription %-(((


sunnycristian  commented on  Tuesday, January 31, 2012  6:58 AM 
tamoxifen without a prescription nanw accutane :-] viagra 865728


wetdogz  commented on  Thursday, February 16, 2012  6:21 PM 
You are commenting using your Facebook account. (&nbsp;&nbsp;/&nbsp;&nbsp;) Connecting to %s Notify me of new posts via email.jQuery(document).ready(function(){HighlanderComments.comment_registration = '';HighlanderComments.userIsLoggedIn = false;});Category Cloud Top PostsRecent PostsArchives&nbsp;(4)&nbsp;(4)&nbsp;(4)&nbsp;(4)&nbsp;(4)&nbsp;(4)&nbsp;(5)&nbsp;(4)&nbsp;(4)&nbsp;(5)&nbsp;(4)&nbsp;(4)&nbsp;(5)&nbsp;(4)&nbsp;(4)&nbsp;(5)&nbsp;(4)&nbsp;(1)&nbsp;(2)&nbsp;(5)&nbsp;(4)&nbsp;(3)&nbsp;(1)&nbsp;(2)&nbsp;(3)&nbsp;(1)&nbsp;(12)Blog Stats137,491 hitsDisclaimerAll data and information provided on this site is for informational purposes only. Mike F Robbins (mikefrobbins.com) makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this site and will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use. All information is provided on an as-is basis.



ojmoss  commented on  Saturday, February 18, 2012  2:56 AM 
I need to do something like:Set AliasName for dbo.RealNameso sql query likeselect * from AliasName.dbo.MyTablewill workI think many people need to do itThank youMassimo Bizzarro



Jorpecom  commented on  Wednesday, February 22, 2012  4:37 AM 
Thanks Heather! I'm obsessed with big, chunky knits. Hopefully one of these days my knitting skills will improve so I can make one myself, but until then I have an incredibly talented grandma to thank. xo



SunshineLuvsU  commented on  Friday, February 24, 2012  2:31 AM 
Paki, aunque con retraso, te comunico que todos los que lo solicist teis a trav s de los coemntarios est is admitidos/as


Name *:
URL:
Email:
Comments:


CAPTCHA Image Validation