1 of 1 people found this helpful
for each "Extended Object Entry:Scheduled Tasks Query//**" ? that should recurse through each item.
Thanks for your input Bill Robinson, you pointed me in the right direction and I have found the solution.
"Extended Object Entry:Scheduled Tasks Query//**" is the correct way to recurse through each object returned by my Extended Object. When I tested this, I found that my task name was found, but the foreach loop was returning an overall non-compliant result. Presumably because it would only be compliant if every object contained a match.
I needed the rule to be compliant if it found just one match, so that led me to experiment with some of the other compliance types.
The obvious choice was Exists Loop (at least one asset must comply)
I stated "Extended Object Entry:Scheduled Tasks Query//**" as my object to loop through.
Then I could select my value to match - Value1 in my case, which is the task name.
Now I get a compliant result when one of the results contains a match.
I can also extend this so that I can match other properties of the scheduled task.
Value1 = TaskName, eg DeleteLogs
Value3 = Status, eg != Could not start
Value6 = Last Result, eg 0
Value11 = Scheduled Task State, eg Enabled
Value14 = Run As User, eg SYSTEM
So now my rule looks like this
and it is only compliant when one entry matches all those conditions, eg