Cancel all workflows in SharePoint 2010
If you've ever had a glitch where custom workflows are all in an error state or other circumstances where you just need to wipe the slate clean of the workflows genreated in SharePoint, use this PowerShell command from the SharePoint 2010 Management Shell:
foreach ($wf in $web.Workflows){[Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf)}
foreach ($wf in $web.Workflows){[Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf)}
Comments