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 ""
}
}