Video Screencast Help

Client Task Execution Report?

Created: 06 Sep 2012 • Updated: 07 Sep 2012 | 2 comments
This issue has been solved. See solution.

Does anyone have the SQL for a Client Task Execution Report from NS 7.1?  I'm looking for info on Client Task Agent executions, not Software Management Delivery...  There are reports for Software Management that work great.  However, none of the built in task reports return what I need and trying to figure out the columns in the 10+ tables in which task info seems to be captured has me befuddled.  In short I need a report that will list the following:  1.  Client computer on which the task ran (not the task server which most of the built in reports seem to return), 2. Task name.  3.  Task execution status.  Success or failure would be great but simple return codes would be OK.  4.  Execution time, preferably end time. 

I need this for an upcoming mass deployment so we can schedule reports proactively to capture task failures or non-execution on client computers before the users come in in hopes of resolving the issues prior to their arrival. 

Comments 2 CommentsJump to latest comment

AlexTH's picture


You can try to start with following query, and modify that with your needs.

select distinct vc.Name, it.Name, eti.EndTime,eti.Success, eti.Result from Evt_Task_Instances eti
join  ItemVersions iv
on eti.TaskVersionGuid = iv.VersionGuid
join vItem it
on it.Guid = iv.ItemGuid
join vComputer vc
on vc.Guid = eti._ResourceGuid
where eti.InstanceType = 'Client'
-- and eti.Success = <1/0>  -->> Succsess status
-- and eti.EndTime > GETDATE()-2 -->> Date_Time Filter
-- and it.Name = '<Task Name>'  -->> TaskName Filter
-- and vc.Name ='<Client Name>' -->> Client Filter
phillyfish's picture

Thanks Alex!  That did it!  A couple of questions\clarifications though.  I am assuming that eti.Result is the return code of the task, like 3010 for "reboot required" etc. and that eti.Success is 0 for "failed" or "not detected" and "1" for success?  Anyway, here's my final SQL, adding a Deployment Filter into which we place computer resources during deployment...

select distinct
     it.Name as Task,
from Evt_Task_Instances eti

join  ItemVersions iv
     on eti.TaskVersionGuid = iv.VersionGuid
join vItem it
     on it.Guid = iv.ItemGuid
join vComputer vc
     on vc.Guid = eti._ResourceGuid
join dbo.CollectionMembership cm
     on vc.Guid = cm.ResourceGuid

     eti.InstanceType = 'Client'
     and <> ''
     and eti.EndTime is not null
     and cm.[CollectionGuid] LIKE '96474896-3347-47ab-8087-361c5c1796c0'
     and eti.EndTime > GETDATE()-2

order by

"If you want to change the world, find a better way to do something and have everyone follow it." John Buckman -