Audit logging for Task execution

Greetings Community!

I’m looking for a way to get some logs either in SCOM console or through SquaredUp on any Tasks executed.
Would need to know Who did execute the task and When.

Any ideas are welcome!

Thank you all

You could use this quick and dirty code that outputs the scom tasks executed to use in a powershell dashboard.

Import-Module OperationsManager
New-SCOMManagementGroupConnection -ComputerName '<Your Management Server>'

# Array
$report=@()


$instances = Get-SCOMTaskResult 


foreach($instance in $instances){



 $properties = @{
                TaskName  = (Get-SCOMTask -id $instance.TaskId).DisplayName
                Submitted   = $instance.submittedby
                TimeStarted = $instance.TimeStarted
                }
                $Object = New-Object -TypeName PSObject -Property $properties
                $report += $Object

}

$report 

Or here is an MP that someone built that creates an alert when a task is triggered.
https://www.souravmahato.com/scom-custom-scom-task-monitoring/

If you only would like an auditing of task then you could use that MP, disable the alert and just collect the Events it creates using a SQL Query targeting the OpsDB/DW

2 Likes