Advertisement
private775

[PS] SharePoint - list webparts on pages

Nov 14th, 2018
374
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://mysharepoint.site.web/'
  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.     "$($item.Title): $($item.Url)"
  13.  
  14.     $mgr = $w.GetLimitedWebPartManager("$($item.Url)", [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
  15.     $mgr.WebParts|%{ "`t$($_.Title) :: $($_.WebBrowsableObject)" }
  16.  
  17.     "=============================================="
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement