0

I have a number of items from a list running on a previous version of workflow instance. Is there an easy way of checking which items are running on a particular version of workflow instance instead of individually checking each item in the list?

enter image description here

1 Answer 1

0

You can use PowerShell cmdlets to get the related item information and export them into Excel or csv.

A demo:

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue

$wf = @()

$web = get-spweb -Identity https://spwebUrl
$list = $web.Lists["ListName"]

foreach ($wf in $list.WorkflowAssociations)
{
    $wfAssociations[$wfAssociations,$wf]
}

if ($wfAssociations.count -ge 1)
{
    foreach ($item in $list.Items)
    {
        foreach($workflow in $item.workflows)
        {
            $wfName = $wf.Name
            $wfStatus = $workflow.InternalState
            $wfListItem = $workflow.ItemName

            write-host "Workflow Title: $wfName Status: $wfStatus ListItem: $wfListItem"
        }
    }
}

How to retrieve workflows in powershell?

1
  • I get an error stating - " The term 'get-SPweb' 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". The name is not incorrect...
    – user86348
    Oct 14, 2019 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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