This PowerShell script allows you to safely target and purge items from a workflow history list to keep the size down and manageable.
|Long Description||In order to get rid of the items and not impact the entire farm, it becomes necessary to utilize paging and indexing to specifically target each item and delete it. Paging helps throttle the traffic to your SQL server down by only deleting x number of items at a time before it rests and starts again. Indexing enables the targeting of items without the performance overhead of enumerating and/or querying a large collection of items.|
To use the script do the following:
Note: By default the script will delete 1000 items and then rest for 1 second.
|Support Info||Aaron Labiosa - How to purge items from a large history list safely via PowerShell|
Nintex Workflow 2010
Nintex Workflow 2013
SharePoint Server 2010
SharePoint Server 2013
Filtering can be added by adding an if statement around the Delete() call as shown below. In this example, the item would be deleted if it was older than 01/01/1999.