Archive for: ‘December 2024’

How to set failed workflow instances as ignored from PS

December 6, 2024 Posted by Alexander Axberg

$scsmMgmtServer = "scsmMGMTServerHere"
$emg = New-Object Microsoft.EnterpriseManagement.EnterpriseManagementGroup $scsmMgmtServer

#MONSTER WORKFLOW LIST
$wfSubs = $emg.Subscription.GetSubscriptionsByCriteria("Name LIKE '%'")

foreach ($wfSub in $wfSubs)
{
    $wfSubFailedInstances = $emg.Subscription.GetFailedSubscriptionStatusById($wfSub.id) | ?{$_.status -eq "Failed"}
    foreach ($subFailedInstance in $wfSubFailedInstances)
    {
        #Ignore
        $emg.Subscription.IgnoreFailedSubscription($subFailedInstance)
    }
}

Source: https://community.cireson.com/discussion/2581/workflows-arent-getting-created-run-and-scsm-console-administration-workflows-status-is-slow