Skip to main content

Products: Nintex Workflow 2016, Nintex Workflow 2013, Nintex Workflow 2010

 

A common cause of workflow failure is large lists, document libraries, task lists and workflow history lists. This article provides instructions on how to locating these large lists.

 

Run the below (attached as well as a *.txt file for your convenience) PowerShell script (PowerShell ISE works well) from a SharePoint Server:

 

The lists returned can be filtered by setting the $threshold variable (default is 200). Additionally, the properties returned can be changed by appending properties to the end of the script (default is ParentWeb, Title, ItemCount).

 

# This will target all Nintex Workflow History lists, you can change the threshold to filter down.
# This is used to find where the lists are and if they are larger than the threshold.
# This will target the entire farm, you may want to scope it down to site collection.

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
#Lists with values higher than threshold will be returned
rint]$threshold = 200
function Get-SPListCollection {
PARAM
(
rParameter(ValueFromPipeline=$true)] eMicrosoft.SharePoint.SPWeb] $SPWeb
)
BEGIN {
  }
END {
}
PROCESS {
  $SPWeb.Lists
  $SPWeb = $null
  bGC]::Collect()
}
}
$(Get-SPWebApplication) | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL | Get-SPListCollection | WHERE {$_.BaseTemplate -eq "WorkflowHistory"} | where {$_.ItemCount -ge $threshold} | FL ParentWeb, Title, ItemCount
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

If there is a need for this script on SharePoint 2007 drop some comments and I can add a separate script that will provide backwards compatibility.


Reply