En iyi yanıtlayıcılar

SCSM 2012 Workflow not running consistently

Soru

I have the workflow which is triggered when an incident is updated and changed from Status = Active or Status = Active/Pending to Status = Resolved. The workflow sets the ActualEndDate property to the current date/time. It seems to work once and it
then stops working. I can see the workflow running and it does output the $objectID value but it seems like the module is not getting loaded when it doesn't work as the output doesn't show the module. Any ideas why the module would not be loaded? Should
I load the module differently?

Thanks for the SQL query, that really helps when trying to figure out what’s wrong. This is the error I'm receiving.
The strange thing is that the workflow runs successfully one time and then starts getting errors… I tried running the script passing the incident number to it (IR1234) and it always runs without any issues. Also, it says the module
is already loaded but I tried to output the module to the log file but the log doesn’t show it loaded.

$a = (get-module|%{$_.name}) -join " "

Add-Content -Path $Logfile "Modules1: $a"

Errors

Import-Module : The following error occurred while loading the extended type data file:
Microsoft.PowerShell, C:\Program Files\Microsoft System Center 2012\Service Manager\Powershell\Microsoft.EnterpriseManagement.Core.Cmdlets\Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml : File skipped because it was already
present from "Microsoft.PowerShell".

Then I get the following error which is pointing to the module not being loaded...I would think this would work since the module is already loaded?

The term 'Get-SCClass' 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.

I also try to remove the module at the end of the script to cleanup and get an error…

Remove-Module : No modules were removed. Verify that the specification of modules to remove is correct and those modules exist in the runspace.