Advertisement
private775

[PS] SharePoint - List All WebParts in Pages

Dec 17th, 2018
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell
  2. clear
  3. $wUrl = 'http://acme.com/'
  4. $lName = 'Pages'
  5.  
  6. $w = Get-SPWeb $wUrl
  7. $l = $w.Lists[$lName]
  8.  
  9. # $item = $l.GetItemById(4)
  10. $l.Items | % {
  11. $item = $_
  12.  
  13. "$($item.Title): $($item.Url)"
  14.  
  15.  
  16. $mgr = $w.GetLimitedWebPartManager("$($item.Url)", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
  17. $mgr.WebParts|%{ "`t$($_.Title) :: $($_.WebBrowsableObject)" }
  18.  
  19. "=============================================="
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement