none
Get a list of all workflows in "Running" state and terminating "running" workflows RRS feed

  • Question

  • Hello,

    I am posting to see if anyone can help me with PowerShell scripts to:

    1. Get a report of all 2013 workflows in "Running" state across a web application and across a site collection.
    2. to terminate all 2013 workflows in "running" state across a web application and a cross a site collection

    The web/application and site collection should be a choice.

    Any help would be appreciated.

    Thank you,

     


    Rumi

    Saturday, September 7, 2019 8:44 PM

All replies

  • I don't think it's possible to get all running workflow instances from entire web application instead you could do something like below.

    Get a List of all 2013 workflows in the SharePoint farm to a .CSV file from below Script.

    if ((Get-PSSnapin 'Microsoft.SharePoint.PowerShell' -ErrorAction SilentlyContinue) -eq $null) {
      Add-PSSnapin 'Microsoft.SharePoint.PowerShell'
    }
    CLS
    $spAssignment = Start-SPAssignment
    $outputFile = 'D:\Temp\2013Workflows.csv'
    $output = '';
    $wfResults = @();
    $i = 0;
    Write-Host 'Searching 2013 Workflows ....' -NoNewline;
     
    # Get All Web Applications
    $WebApps = Get-SPWebApplication
    foreach($webApp in $WebApps) {
      # Get All Site Collection
      foreach ($spSite in $webApp.Sites)    {
        # get the collection of webs
        foreach($spWeb in $spSite.AllWebs) {
          $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($spWeb)
          $wfsService = $wfm.GetWorkflowSubscriptionService()
          foreach ($spList in $spWeb.Lists) {
            $subscriptions = $wfsService.EnumerateSubscriptionsByList($spList.ID)
            foreach ($subscription in $subscriptions) {
              #$subscriptions.name
              #$subscriptions.PropertyDefinitions#._UIVersionString #_IsCurrentVersion
              $i++
              #excluding multiple version of the same workflow
              if (($spWeb.Url + $spList.Title + $subscriptions.Name) -ne $output) {
                $output = $spWeb.Url + $spList.Title + $subscription.Name    
                $wfID = $subscription.PropertyDefinitions["SharePointWorkflowContext.ActivationProperties.WebId"]        
                $wfResult = New-Object PSObject;
                $wfResult | Add-Member -type NoteProperty -name 'URL' -value ($spWeb.URL);
                $wfResult | Add-Member -type NoteProperty -name 'ListName' -value ($spList.Title);
                $wfResult | Add-Member -type NoteProperty -name 'wfName' -value ($subscription.Name);
                $wfResult | Add-Member -type NoteProperty -name 'wfID' -value ($wfID);
                $wfResults += $wfResult;
              }
              if ($i -eq 10) {Write-Host '.' -NoNewline; $i = 0;}
            }
          }
        }
      }
    }
    $wfResults | Export-CSV $outputFile -Force -NoTypeInformation
    Write-Host
    Write-Host 'Script Completed'
    Stop-SPAssignment $spAssignment

    If you need a report for only specific web application then just run the below script.

    if ((Get-PSSnapin 'Microsoft.SharePoint.PowerShell' -ErrorAction SilentlyContinue) -eq $null) {
      Add-PSSnapin 'Microsoft.SharePoint.PowerShell'
    }
    CLS
    $spAssignment = Start-SPAssignment
    $outputFile = 'D:\Temp\2013Workflows.csv'
    $output = '';
    $wfResults = @();
    $i = 0;
    Write-Host 'Searching 2013 Workflows ....' -NoNewline;
     
    # Get All Web Applications
    $WebApp = Get-SPWebApplication "https://portal.contoso.com"
    #foreach($webApp in $WebApps) {
      # Get All Site Collection
      foreach ($spSite in $webApp.Sites)    {
        # get the collection of webs
        foreach($spWeb in $spSite.AllWebs) {
          $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($spWeb)
          $wfsService = $wfm.GetWorkflowSubscriptionService()
          foreach ($spList in $spWeb.Lists) {
            $subscriptions = $wfsService.EnumerateSubscriptionsByList($spList.ID)
            foreach ($subscription in $subscriptions) {
              #$subscriptions.name
              #$subscriptions.PropertyDefinitions#._UIVersionString #_IsCurrentVersion
              $i++
              #excluding multiple version of the same workflow
              if (($spWeb.Url + $spList.Title + $subscriptions.Name) -ne $output) {
                $output = $spWeb.Url + $spList.Title + $subscription.Name    
                $wfID = $subscription.PropertyDefinitions["SharePointWorkflowContext.ActivationProperties.WebId"]        
                $wfResult = New-Object PSObject;
                $wfResult | Add-Member -type NoteProperty -name 'URL' -value ($spWeb.URL);
                $wfResult | Add-Member -type NoteProperty -name 'ListName' -value ($spList.Title);
                $wfResult | Add-Member -type NoteProperty -name 'wfName' -value ($subscription.Name);
                $wfResult | Add-Member -type NoteProperty -name 'wfID' -value ($wfID);
                $wfResults += $wfResult;
              }
              if ($i -eq 10) {Write-Host '.' -NoNewline; $i = 0;}
            }
          }
        }
      }
    #}
    $wfResults | Export-CSV $outputFile -Force -NoTypeInformation
    Write-Host
    Write-Host 'Script Completed'
    Stop-SPAssignment $spAssignment

    Below one will get a report of all 2013 workflows for a Site Collection.

    if ((Get-PSSnapin 'Microsoft.SharePoint.PowerShell' -ErrorAction SilentlyContinue) -eq $null) {
      Add-PSSnapin 'Microsoft.SharePoint.PowerShell'
    }
    CLS
    $spAssignment = Start-SPAssignment
    $outputFile = 'D:\Temp\2013Workflows.csv'
    $output = '';
    $wfResults = @();
    $i = 0;
    Write-Host 'Searching 2013 Workflows ....' -NoNewline;
     
    # Get All Web Applications
    $SiteCollection = Get-SPSite "https://portal.contoso.com/sites/portal"
    #foreach($webApp in $WebApps) {
      # Get All Site Collection
      #foreach ($spSite in $webApp.Sites)    {
        # get the collection of webs
        foreach($spWeb in $SiteCollection.AllWebs) {
          $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($spWeb)
          $wfsService = $wfm.GetWorkflowSubscriptionService()
          foreach ($spList in $spWeb.Lists) {
            $subscriptions = $wfsService.EnumerateSubscriptionsByList($spList.ID)
            foreach ($subscription in $subscriptions) {
              #$subscriptions.name
              #$subscriptions.PropertyDefinitions#._UIVersionString #_IsCurrentVersion
              $i++
              #excluding multiple version of the same workflow
              if (($spWeb.Url + $spList.Title + $subscriptions.Name) -ne $output) {
                $output = $spWeb.Url + $spList.Title + $subscription.Name    
                $wfID = $subscription.PropertyDefinitions["SharePointWorkflowContext.ActivationProperties.WebId"]        
                $wfResult = New-Object PSObject;
                $wfResult | Add-Member -type NoteProperty -name 'URL' -value ($spWeb.URL);
                $wfResult | Add-Member -type NoteProperty -name 'ListName' -value ($spList.Title);
                $wfResult | Add-Member -type NoteProperty -name 'wfName' -value ($subscription.Name);
                $wfResult | Add-Member -type NoteProperty -name 'wfID' -value ($wfID);
                $wfResults += $wfResult;
              }
              if ($i -eq 10) {Write-Host '.' -NoNewline; $i = 0;}
            }
          }
        }
      #}
    #}
    $wfResults | Export-CSV $outputFile -Force -NoTypeInformation
    Write-Host
    Write-Host 'Script Completed'
    Stop-SPAssignment $spAssignment
    Thanks & Regards,


     

    sharath aluri

    Sunday, September 8, 2019 12:19 PM
  • Below script will cancel all the running workflow instances from a entire site collection by looping through all subsites and lists.

    if ((Get-PSSnapin 'Microsoft.SharePoint.PowerShell' -ErrorAction SilentlyContinue) -eq $null) {
      Add-PSSnapin 'Microsoft.SharePoint.PowerShell'
    }
    
    $site = Get-SPSite "https://portal.contoso.com/sites/portal"
    if($site)
    {
      $spWebCollection = $site.AllWebs;
      $i = 0;
      $iWebCount = $spWebCollection.Count;
    
      do 
      {
        Write-Host $i; 
    
        $web = $spWebCollection[$i];
        $spListCollection = $web.Lists;
        $iListCount = $spListCollection.Count;
    
        $j = 0;
        do
        {
          $list = $spListCollection[$j];
          $spItemCollection = $list.Items;
          $iItemCount = $spItemCollection.Count;
          $k = 0;
    
          do 
          { 
            $item = $spItemCollection[$k];
            $spWorkflowCollection = $item.Workflows;
            if($spWorkflowCollection)
            {
              $iWorkflowCount = $spWorkflowCollection.Count;
              $l = 0;
     
              do
              { 
                $workflow = $spWorkflowCollection[$l]; 
                if($workflow)
                {
                  if($workflow.InternalState -ne 'Completed' -and $workflow.InternalState -ne 'Cancelled')
                  {
                    [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($workflow); 
                  }
                }
                $l++;
              } 
              while ($l -lt $iWorkflowCount)
            }
            $k++;
          }
          while ($k -lt $iItemCount)
          $j++;
        }
        while ($j -lt $iListCount)
       
        # Site Workflows
        $spWorkflowCollection = $web.Workflows;
        if($spWorkflowCollection)
        {
          $iWorkflowCount = $spWorkflowCollection.Count;
          $w = 0;
    
          do
          { 
            $workflow = $spWorkflowCollection[$w]; 
            if($workflow)
            {
              if($workflow.InternalState -ne 'Completed' -and $workflow.InternalState -ne 'Cancelled')
              {
                [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($workflow); 
              }
            }
            $w++;
          } 
          while ($w -lt $iWorkflowCount)
        }
        $web.Dispose();
        $i++;
      }
      while ($i -lt $iWebCount)
    
      $site.Dispose()
    }
    Thanks & Regards,


    sharath aluri

    Sunday, September 8, 2019 12:28 PM
  • Hi, Rumi,

    Here is a script to stop running workflows in your site collection. Have a try on it.

    #Site URL
    $spweb = Get-SPWeb "sitecoll url";
    for ($i = 0; $i -lt $spweb.Lists.Count; $i++)
    {
      $list = $spweb.Lists[$i];
    # Iterate through all Items in List and all Workflows on Items.         
    foreach ($item in $list.Items) {
    foreach ($wf in $item.Workflows) {
    
    #Cancel Workflows        
    [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf);      
    }
    }
    }
     
    foreach ($web in $spweb.webs )
    {
    for ($i = 0; $i -lt $web.Lists.Count; $i++)
    {
      $list = $web.Lists[$i];
    # Iterate through all Items in List and all Workflows on Items.         
    foreach ($item in $list.Items) {
    foreach ($wf in $item.Workflows) {
    
    #Cancel Workflows        
    [Microsoft.SharePoint.Workflow.SPWorkflowManager]::CancelWorkflow($wf);      
    }
    }
    }
    }
    $web.Dispose();

    Here are some more scripts you can take as references:

    https://paulryan.com.au/2014/cancel-all-workflows/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Proposed as answer by Michael Han6 Thursday, September 12, 2019 7:38 AM
    Monday, September 9, 2019 8:26 AM
  • Thank you both Sharath and Jerry.  I am going to test these and let you know.

    Will report my findings soon.

    Thanks again!


    Rumi

    Monday, September 9, 2019 1:25 PM
  • Hello Sharath,

    I ran the script against a web/app and it does successfully produce a list of all 2013 workflows in the web application.  Is there a way to also include the "state" of the workflow?  For example, if it is running/in progress, completed, etc?

    Also, in your script to cancel all running workflows, can we run it against a web/application and output it to a log showing which workflows were cancelled?  

    Thank you,


    Rumi


    Monday, September 9, 2019 1:43 PM
  • Hello Jerry and Sharath,

    A couple of questions about these scripts:

    1. Are they specific to 2013 Workflows?
    2. Are they providing a list of workflows that are in running state?
    3. Is the one that cancels the running workflows is for 2013 workflows?

    Thank you,


    Rumi

    Friday, September 13, 2019 1:54 PM
  • Yes the above scripts will get you only 2013 workflows.

    No, they are not providing any list of workflow instances that are in running state.

    Yes it is for 2013 workflows.

    Thanks & Regards,


    sharath aluri

    Friday, September 13, 2019 2:08 PM
  • Sharath,

    Thank you.  I opened this thread with the following:

    • Get a report of all 2013 workflows in "Running" state across a web application and across a site collection.
    • to terminate all 2013 workflows in "running" state across a web application and a cross a site collection

    Is it possible to get the workflow instances that are in Running state?

    Thank you,


    Rumi

    Friday, September 13, 2019 2:32 PM
  • It's hard to get all the running workflow instances at entire Web Application level instead you could use the above script to get all workflows and from the below script you would get all running workflow instances for a Single List.

    Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
    
    $sitColurl = “Your_SiteUrl”
    
    $site = New-Object Microsoft.SharePoint.SPSite($sitColurl)
    $web = $site.OpenWeb()
    $web.AllowUnsafeUpdates = $true;
    $list = $web.Lists[“ListName”];
    
    Write-Host “Your List Name Name :” $list.Title
    $wfm=New-objectMicrosoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
    $workflowInstanceService=$wfm.GetWorkflowInstanceService()
    
    foreach($itemin$list.Items) {
    $workflowInstances=$workflowInstanceService.EnumerateInstancesForListItem($list.ID,$item.ID)
    
    foreach($wfin$workflowInstances) {
    IF ($wf.Status -eq “Started”) {
    write -host “Running workflow Name is:” $wf.Name
       }   
      }
    }

    It can be possible but have to work on the script instead you could use the above script for Site Collection Level.

    Thanks & Regards,


    sharath aluri

    Friday, September 13, 2019 3:29 PM
  • Sharath,

    The above script would have to be run for each list that has 2013 workflow within a site collection.  Is will be quite cumbersome and time consuming.  But, I understand.  However, when running the script for the list, I get this error:

    Also - lists exist in sub sites - so, do we only specify the site collection variable?

    PS D:\Tools\Scripts\WFM> D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1
    Your List Name Name : test1
    New-objectMicrosoft.SharePoint.WorkflowServices.WorkflowServicesManager : The term 'New-objectMicrosoft.SharePoint.WorkflowServices.WorkflowServicesManager' is not
    recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
    correct and try again.
    At D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1:11 char:6
    + $wfm=New-objectMicrosoft.SharePoint.WorkflowServices.WorkflowServicesManager($we ...
    +      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (New-objectMicro...ServicesManager:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    You cannot call a method on a null-valued expression.
    At D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1:12 char:1
    + $workflowInstanceService=$wfm.GetWorkflowInstanceService()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    You cannot call a method on a null-valued expression.
    At D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1:15 char:1
    + $workflowInstances=$workflowInstanceService.EnumerateInstancesForListItem($list. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    You cannot call a method on a null-valued expression.
    At D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1:15 char:1
    + $workflowInstances=$workflowInstanceService.EnumerateInstancesForListItem($list. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
     
    You cannot call a method on a null-valued expression.
    At D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1:15 char:1
    + $workflowInstances=$workflowInstanceService.EnumerateInstancesForListItem($list. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

    Friday, September 13, 2019 3:42 PM
  • Sorry there was a space missing for that line of command try this. Just Mention your Site Url & List Name

    Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
    
    $sitColurl = “Your_SiteUrl”
    
    $site = New-Object Microsoft.SharePoint.SPSite($sitColurl)
    $web = $site.OpenWeb()
    $web.AllowUnsafeUpdates = $true;
    $list = $web.Lists[“ListName”];
    
    Write-Host “Your List Name Name :” $list.Title
    $wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
    $workflowInstanceService = $wfm.GetWorkflowInstanceService()
    
    foreach($itemin$list.Items) {
    $workflowInstances=$workflowInstanceService.EnumerateInstancesForListItem($list.ID,$item.ID)
    
    foreach($wfin$workflowInstances) {
    IF ($wf.Status -eq “Started”) {
    write -host “Running workflow Name is:” $wf.Name
       }   
      }
    }
    Thanks & Regards,


    sharath aluri


    Friday, September 13, 2019 4:01 PM
  • Sharath,

    Nevermind on the error.  There was a typo.

    But my workflows are across many lists within the site collection and in sub sites.  Would I have to specify the url for each subsite? 

    Also, below is the result of the script.  It is accurate in the sense that it displays the correct number of in progress workflow items but it doesn't give any details.  It would be nice to have at least, the item name.

     

    PS C:\Windows\system32> D:\Tools\Scripts\WFM\GetWFInstanceInList.ps1
    Your List Name Name : test2
    -host
    Running workflow Name is:
    -host
    Running workflow Name is:
    -host
    Running workflow Name is:
    -host
    Running workflow Name is:

    PS C:\Windows\system32>


    Rumi

    Friday, September 13, 2019 4:04 PM
  • The script will return all Workflows currently associated within your SharePoint farm using PowerShell, and outputs it to a file. It returns the URL of the site, Title of the list, Title of the workflow, and the name of currently Running Instances of the workflow.

    Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
    $webapps = @()
    $File ="Type location for the output file. For example C:\Desktop\Workflows.txt"
    foreach ($site in Get-SPSite -Limit All) {
    $sitelists = foreach ($web in $site.AllWebs) {
    foreach ($list in $web.Lists) {
                                    foreach ($item in $list.workflowassociations | where {$_.runninginstances -gt 0}) {
                                                    if ("$($web.URL)") {
                                                                    Write-Output $web.URL $list.Title $item.Name $item.runninginstances " " " " | Out-File $File -Append
                                                    }
                                                    }
                                    }
                    }
    }

    Modified the script from the below article. Try the above script and see.

    https://github.com/chrisdee/Scripts/blob/master/PowerShell/Working/SharePoint/SharePoint2013/SP2013EnumWorkFlows.ps1

    Thanks & Regards,


    sharath aluri

    Friday, September 13, 2019 4:31 PM
  • You are awesome, Sharath.  I will test this.  But, is there anyway we can run this :

    1.  Across a web/app
    2.  Across a site collection

    Thanks,


    Rumi

    Friday, September 13, 2019 5:01 PM
  • I am sorry got something important office work, Try with the below updated script and see.

    Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
    
    #Web application URL and CSV File location Variables
    $WebAppUrl = "http://sharepoint.ampio.com"
    $CSVFile = "C:\Temp\Workflows.txt"
    
    #Get the Web Application
    $WebApp = Get-SPWebApplication $WebAppUrl
    
    #Get all Site collections from the web application
    $SitesCollection  = $WebApp.Sites
    
    #Enumerate all site collections in the web application
    foreach ($site in $SitesCollection) 
    {
     $sitelists = foreach ($web in $site.AllWebs) 
      {
      foreach ($list in $web.Lists) 
      {
       foreach ($item in $list.workflowassociations | where {$_.runninginstances -gt 0}) 
       {
        If ("$($web.URL)") 
        {
         Write-Output $web.URL $list.Title $item.Name $item.runninginstances " " " " | Out-File $CSVFile -Append
        }
       }
      }
     }
    }

    Thanks & Regards,


    sharath aluri


    Friday, September 13, 2019 10:27 PM
  • Thank you, Sharath.  I just tested this and unfortunately it does not provide 2013 workflows in progress. It does produce 2010 workflows in progress though.

    Rumi

    Saturday, September 14, 2019 6:19 PM
  • The script will return all Workflows currently associated within your SharePoint farm using PowerShell, and outputs it to a file. It returns the URL of the site, Title of the list, Title of the workflow, and the name of currently Running Instances of the workflow.

    Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
    $webapps = @()
    $File ="Type location for the output file. For example C:\Desktop\Workflows.txt"
    foreach ($site in Get-SPSite -Limit All) {
    $sitelists = foreach ($web in $site.AllWebs) {
    foreach ($list in $web.Lists) {
                                    foreach ($item in $list.workflowassociations | where {$_.runninginstances -gt 0}) {
                                                    if ("$($web.URL)") {
                                                                    Write-Output $web.URL $list.Title $item.Name $item.runninginstances " " " " | Out-File $File -Append
                                                    }
                                                    }
                                    }
                    }
    }

    Modified the script from the below article. Try the above script and see.

    https://github.com/chrisdee/Scripts/blob/master/PowerShell/Working/SharePoint/SharePoint2013/SP2013EnumWorkFlows.ps1

    Thanks & Regards,


    sharath aluri

    I just tried this script but unfortunately this does not report any 2013 workflows.  It only shows 2010 workflows.

    Rumi

    Saturday, September 14, 2019 6:46 PM
  • Hi Sharath and Jerry -

    Anyway we can get In Progress/Running instances of 2013 workflows in your script?  The ones you have provided only returns 2010 workflows.

    Thank you,


    Rumi

    Monday, September 16, 2019 9:18 PM