Need to know the property to find if the Workflow Template is 2010 or 2013

sumacasu 11 Reputation points
2020-07-30T15:00:34.827+00:00

We are trying to find SharePoint 2010 Workflows running in an OnPrem 2013 environment, I'm writing a PowerShell Script to iterate all the lists associated workflows on the farm, I need to know the property of $WorkflowObject which I can utilize to differentiate if associated workflow is SP Designer 2010 or 2013.

Below my Script which I am currently running:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
$outputFile = "C:\WorkflowReport.txt";

$farm = [Microsoft.SharePoint.Administration.SPFarm]::local
$websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()

$outputHeader = "Url;List;Workflow;Running Instances" > $outputFile

foreach ($websvc in $websvcs) {

foreach ($webapp in $websvc.WebApplications) { 

foreach ($site in $webapp.Sites) {
foreach ($web in $site.AllWebs) {
foreach ($List in $web.Lists) {
foreach ($workflow in $List.WorkflowAssociations) {
if ($workflow.BaseTemplate -eq 'null' -and $workflow.Contains("Xoml"))
{
#SPD workflow
Write-Host $output = $web.Url + ";" + $List.Title + ";" + $workflow.Name + ";" + $workflow.RunningInstances
Write-Output $output >> $outputFile
}
else
{
#OOB Workflow
}

}}
} 

}
}
}
$Web.Dispose();
$site.Dispose();

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,955 questions
{count} votes

1 answer

Sort by: Most helpful
  1. George Winters (Admin) 1 Reputation point
    2020-08-03T15:41:48.213+00:00
    1. I didn't find any properties in the workflow object.
    2. There is a free workflow scanner from Microsoft that will produce a report detailing which workflows are 2010 and which are 2013
      1. I tried creating test SPD workflows of both types - So far, only the 2010 type workflow creates a folder in the \Workflows\ folder. The 2013 workflow did not.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.