tag:blogger.com,1999:blog-2214780243815864156.post6374680603913867524..comments2023-05-19T10:15:31.744+02:00Comments on [Code]Beaver: Restarting a workflow - ScriptedAnders Spællinghttp://www.blogger.com/profile/01490099464550485079noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2214780243815864156.post-70619091195284390722014-07-29T08:59:19.705+02:002014-07-29T08:59:19.705+02:00Cheers. Feel free to change the script however you...Cheers. Feel free to change the script however you like to suit your needs. I left in the option of having custom statuses in the original script as it is easier to remove than to add.Anders Spællinghttps://www.blogger.com/profile/01490099464550485079noreply@blogger.comtag:blogger.com,1999:blog-2214780243815864156.post-872668638677690492014-07-29T04:54:49.888+02:002014-07-29T04:54:49.888+02:00Thanks for the script. I got the same problem. Our...Thanks for the script. I got the same problem. Our SR stuck intermittently after RB activities. We have put them on hold and resume to workaround the problem. <br /><br />I have to change your script a bit to make it work on our environment (SCSM 2012 R2)<br /><br />From:<br />$sCriteria = "(Status = '$SRStatusInProgressId' or Status = '$SRStatusInProgressPendingId' or Status = '$SRStatusInProgressUpdatedId') and LastModified < '$Then'"<br />$SRClass = Get-SCSMClass system.workitem.servicerequest$<br /><br />$Criteria = New-Object "Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectCriteria" $sCriteria, $SRClass<br /><br />To:<br /><br />$sCriteria = "(Status = '$SRStatusInProgressId') and LastModified < '$Then'"<br />$SRClass = Get-SCSMClass -Name system.workitem.servicerequest<br />$Criteria = New-Object -TypeName "Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectCriteria" -ArgumentList $sCriteria,$SRClass<br />Johttps://www.blogger.com/profile/01729639550933712209noreply@blogger.com