HowTo: Terminate all SharePoint 2013 workflows

Here's the code:

$credentials = get-credentials

$uri = new-object

#note:  I'm not sure if these GUIDs are the same for eery workflow
farm or not.  YOu can find this in the WFResourceManagementDB.Scopes
table on your SQL Server.  You will need the full path.

$dcli = new-object Microsoft.Workflow.client.WorkflowManagementClient($uri, $credentials);

$im = $dcli.instances

$im.get() #this will show you all instances of workflows that have executed on your farm (even the ones that are still waiting)

foreach($inst in $im.get())


$im.Terminate($inst.WorkflowName, $inst.InstanceName, "Because I said so");


Leave a Reply