Maybe you can help. I need to report the actual exit codes from the running tasks. While the report in Reports\Task Server\Status\Job/Task Status Detail is ok, it reports only the status. I have to have the actual exit codes. For example, when you run Windows 10 compatibility scan, it exits with -1047526896 code.
It translates into (0xC1900210) in hex, that stands for "it does not find any compat issue". According to https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-command-line-options there are few more codes that need to have a track of:
I have a custom sql code, that returns output of the task, but not the exit code.
Any ideas ?
I have amended the existing report and I managed to throw 2 birds with one stone. For reference I paste the report for script task execution. It reports both the output as well as the exit code.
i.Name as 'Task Name',
replace(replace(replace(replace(cast(to2.Value as NVarchar(max)), '/',''), 'string', ''), 'int', ''),'<>','') as [Output],
ti.Name as 'Task Instance Name'
from TaskInstanceSummaries ti
left join TaskInstanceParents tip on tip.ParentTaskInstanceGuid = ti.TaskInstanceGuid
left join TaskOutputPropertyValue to2 on to2.TaskInstanceGuid = tip.TaskInstanceGuid
join ItemVersions iv on iv.VersionGuid = ti.TaskVersionGuid -- Find the name of the task
join Item i on i.Guid = iv.ItemGuid
join Evt_Task_Instances eti on eti.TaskInstanceguid = tip.TaskInstanceGuid
join vComputer vc on vc.guid = eti._ResourceGuid
where i.Name = 'Windows 10 Setup with Compatibility Scan'
and to2.Name = 'scriptoutput'
order by ti.StartTime desc
I hope it helps others having the same dilema.