View Historic Actions

Hi all,

I’m trying to get historic data of executed actions, including the exit code and the executed command. Does anyone know how to do this? Maybe I’m over complicating it.

I can get the last action from the DB with this…


USE BFEnterprise
SELECT
c.ComputerID
,c.IsDeleted
,c.LastReportTime
,replace(c.ComputerName,char(10),’’) as ComputerName
,ar.ActionID
,ar.State
,ar.StartTime
,ar.EndTime
,ar.TryCount
,ar.RetryCount
,ar.ExitCode

FROM COMPUTERS c
join actionresults ar on ar.ComputerID = c.ComputerID

where c.ComputerName = ‘ABC123’ + char(10)
and c.IsDeleted = 0
order by computername


It shows only details of the last action.

It increments the “ar.TryCount” and “ar.RetryCount” values, but it appears there’s no history being maintained for previous attempts.

Thanks,
Joe