简体   繁体   中英

SharePoint 2010 Delete Completed Workflow History In List Item

I had a workflow create a new version every 5 minutes for two weeks. It has caused a pretty big mess and the history is taking up a lot of space. I have fixed the workflow, deleted all the version history and I'm deleting items out of the Workflow History list right now. The area that I'm stuck in is the completed workflow history inside of list item its self. I don't have central administration access, so I can't run a script to delete it. I do have access to Designer. I tried removing the workflows and then publishing them again, that did not remove the history. The list is currently 700 MB with only 250 list items inside of it. There are no attachments in the list. Any suggestions on how to get ride of the completed workflow history would be greatly appreciated.

You can easily do this using the object model and PowerShell:

$spweb = Get-SPWeb http://sps-server/website
$splist = $spweb.Lists["YourList"]
$spitem = $splist.GetItemById(1)
$spitem.Workflows | % { $web.Site.WorkflowManager.RemoveWorkflowFromListItem($_) }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM