I Written this script to bulk delete old completed workflow tasks with related history items by specify the date that script will stop delete until it.
The script were treated to deal with a huge number of data.
1. Read the Instructions in the top of the file to set the script parameters
2. The Script query to select all items with status = completed and date before specific date , be attention to modify the query for non English task status
3. Script will not delete from the SharePoint recycle bin because of slowness , the best solution from my opinion is to disable the recycle bin from the central administration before run the script that will delete all items from the SharePoint content database ” that is our target ”
4. You can run the script in log mode only that will log all items to delete and will log the batch messages for tasks and history items without actual delete by set the $LogOnly variable to $true ( follow the instructions in the top of the file to do that )
The biggest problem that i faced is the quotation marks for the batch XML message but this post save my time , thanks to the writer 🙂 🙂
Have a nice SharePoint administration 🙂