1

I have workflow instance causing workflow manager backend service to crash. I want to delete this instance. I only know the instance ID of the workflow, how can i get the details, such as Item Id, List ID, Site name?

1

Try the following Script

$site = Get-SPSite "http://epm"
$wfinstanceid="c3dfe396-ba8c-4937-a626-a8e2382f01f4" 
foreach ($web in $site.AllWebs)
{

 foreach ($list in $web.Lists) 
 { 
   foreach ($wf in $list.WorkFlowAssociations) 
    {   
     if($wf.id -eq $wfinstanceid){  
      write-host "Workflow -->" $wf.Name 
      write-host "Parent Site -->" $wf.ParentSite 
      write-host "Parent Web -->" $wf.ParentWeb
      write-host "List Title -->" $wf.ParentList
      write-host "List Title -->" $wf.TaskListTitle
     }
    }

 }
}
$web.Dispose()
$site.Dispose()

output

enter image description here

Note:

  • Replace $site with your site collection URL.
  • Replace $wfinstanceid with your workflowID.
  • To get more details from the current available data in if condition above add $wf. and click tab button from keyboard and check the available property.
1
  • Thanks a lot for the script, couldn't match with the instance ID i had though. I had received this Workflow Instance from WF DB. – Kushal Bhabra Dec 24 '16 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.