Hi,
Im trying to run a script to stop all running/suspended workflows on a list, Im using the scrip below but it doesnt seem to do anything. Can anyone see what i'm doing wrong?
#Site URL
$SiteUrl = “https://sharepoint.domain.net/ICT/TEST”
$web = Get-SPweb $SiteUrl
$web.AllowUnsafeUpdates = $true;
#List Name
$list = $web.Lists["Workflow test"];
# 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();









