Skip to content

Instantly share code, notes, and snippets.

@joerodgers
Created September 22, 2017 18:57
Show Gist options
  • Save joerodgers/add3c9956ceb625025c9803e4408b3dc to your computer and use it in GitHub Desktop.
Save joerodgers/add3c9956ceb625025c9803e4408b3dc to your computer and use it in GitHub Desktop.
Display all lists in a SharePoint 2013+ farm that have >5k items
Get-SPSite -Limit All | Get-SPWeb -Limit All | ? { -not $_.IsAppWeb } | % {
foreach( $list in $_.Lists )
{
if( $list.ItemCount -gt 5000 )
{
[PSCustomObject] @{
WebUrl = $list.ParentWeb.Url
List = $list.Title
ListUrl = $list.ParentWeb.Site.MakeFullUrl($list.DefaultViewUrl)
ItemCount = $list.ItemCount
Hidden = $list.Hidden
Type = $list.BaseTemplate
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment