8/02/2016

PowerShell to Find SharePoint Views Configured for More Than 5000 Items

 

Have any of your site owners been trying to create views with more than 5000 items? Have you changed the row limit to more than 5000 and have decided to set it back? Here’s some PowerShell to find all Views with a RowLimit set to more than 5000.

Here’s some PowerShell to find those views in an on premise SharePoint.

Get-SPSite -Limit All | 
   Select -ExpandProperty AllWebs |
   Select -ExpandProperty Lists |
   Select -ExpandProperty Views |
   Where {$_.RowLimit -gt 5000} |
   Select {$_.ParentList.ParentWebUrl}, {$_.ParentList.Title}, {$_.ParentList.ItemCount}, {$_.paged}, {$_.RowLimit} | ft -autosize

 

There are two properties of interest in the View object:

  • Paged – Boolean – is paging enabled for the view.
  • RowLimit – integer – number of items to display per page.

If you wanted to only include views without paging then change the Where line to:

    Where { ($_Paged –eq $false) –AND ($_.RowLimit -gt 5000) } |

 

.

No comments:

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.