System Center Orchestrator SQL Query–Runbook Run Count

This will be a short Post, sometimes it can be helpful to get a List of Runbooks and the Count, on how many times the Runbook has been executed.

Maybe if you are looking for most executed Runbook in case of an Performance Issue or you just want to track your environment.

Get Runbook Execution Count from the last Month

use Orchestrator

select	Name, count(policies.UniqueID) as Count from Policies 
inner join POLICYINSTANCES on policies.UniqueID=POLICYINSTANCES.PolicyID 
where POLICYINSTANCES.TimeEnded > DATEADD(mm,-1,GETDATE()) 
group by name 
order by Count Desc


 

 

The Result should look like this.

image

Michael Seidl aka Techguy

Leave a Comment

Your email address will not be published. Required fields are marked *

*