How can I find out which items in my list are running the old version of the workflow?

enter image description here


You can do this via Powershell. Since the previous workflow versions get a different name on replacement, you could check against the name (you could also check against the creation date, of course).

For example

$listName = "ABC"
$workflowName = "ABC-WF"
$site = Get-SPSite("http://myspsite")
$web = $site.OpenWeb()
$list = $web.Lists.TryGetList($listName)
$itemsWithDiffWorkflow = $list.Items | Where-Object { $_.Workflows | Where-Object { $_.ParentAssociation.Name -ne $workflowName -and $_.IsCompleted -eq $false } }
if($itemsWithDiffWorkflow -ne $null)
    foreach($item in $itemsWithDiffWorkflow)
        write-host $item.Title

This prints out all the item titles of items that have it's workflow not completed and the workflow is not named "ABC" (the newest version). If you have more than one workflow associated with the list, you have to change the script accordingly.

| improve this answer | |
  • Thanks, this looks promising but it looks like this won't work for me as I don't have access to the server SharePoint is installed on. It doesn't like Get-SPSite – Enilorac Jun 28 '15 at 11:02

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.