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?
1 Answer
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"
}
}
}
-
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... Oct 14, 2019 at 1:20