Monday, March 9, 2015

Find All Large Lists Exceeding Threshold Limit in SharePoint using PowerShell

Requirement: Find all lists exceeding the list view threshold limit configured on Web Application's resource throttling settings.

powershell to find large lists exceeding threshold limit in sharepoint

PowerShell Script to find all Large Lists which are exceeding the configured threshold limit:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get All Web Applications
$WebAppsCollection = Get-SPWebApplication

#Array to Hold Result - PSObjects
$LargeListsResult = @()

foreach($WebApp in $WebAppsCollection)
    #Get the Throttling Limit of the Web App
    $Threshold = $WebApp.MaxItemsPerThrottledOperation

    foreach($Site in $WebApp.Sites)
        foreach($Web in $Site.AllWebs)
            Write-host "Scanning site:"$Web.URL
            foreach($List in $Web.Lists)
                if($list.ItemCount -gt $Threshold)
                    $Result = New-Object PSObject
                    $Result | Add-Member NoteProperty Title($list.Title)
                    $Result | Add-Member NoteProperty URL($web.URL)
                    $Result | Add-Member NoteProperty Count($list.ItemCount)
                    #Add the object with property to an Array
                    $LargeListsResult += $Result
Write-host "Total Number of Large Lists Found:"$LargeListsResult.Count -f Green

#Export the result Array to CSV file
$LargeListsResult | Export-CSV "c:\LargeListData.csv" -NoTypeInformation        

This script generates a CSV file at "C:\LargeListData.CSV", Just open it in Microsoft Excel, apply some formatting and here is how the report looks like:
get large lists report in sharepoint using powershell

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...