Applicable when NOT applicable

I created a task with this relevance…

NOT (exists service whose (service name of it as string as lowercase = "windowsazureguestagent" as string as lowercase))
OR
NOT (exists service whose (service name of it as string as lowercase = "himds" as string as lowercase))

But some systems are showing relevance even though they have the service. So I thought it was my relevance but after logging in and testing with qna, it shows it should not be relevant…

This is occurring on dozens of systems for this same task.

What am I doing wrong?

A system will have only one of those two services or neither, it will never have both.

So with that if a machine has windowsazureguestagent but not himds it would be True, likewise if it has himds but not windowsazureguestagent it would be true due to the OR. I think what your need is

not ((exists service whose (service name of it as lowercase = "windowsazureguestagent")) or (exists service whose (service name of it as lowercase = "himds")))

If it has either, it should not be relevant.

We are looking for systems that do not have either of these services.

Yep, that what that should do. If I use a service I do have, such as besclinet, that shows how your original expression still evaluates as True where as my suggestion does not.

Q: NOT (exists service whose (service name of it as string as lowercase = "windowsazureguestagent" as string as lowercase)) OR NOT (exists service whose (service name of it as string as lowercase = "besclient" as string as lowercase))
A: True
T: 272.180 ms
I: singular boolean

Q: not ((exists service whose (service name of it as lowercase = "windowsazureguestagent")) or (exists service whose (service name of it as lowercase = "besclient")))
A: False
T: 267.866 ms
I: singular boolean

If you strip back to just boolean checks

Q: false or true
A: True
T: 0.273 ms
I: singular boolean

Q: true or false
A: True
T: 0.245 ms
I: singular boolean

Q: true or true
A: True
T: 0.192 ms
I: singular boolean

Q: false or false
A: False
T: 0.163 ms
I: singular boolean

Q: not (false or true)
A: False
T: 0.134 ms
I: singular boolean

Q: not (true or false)
A: False
T: 0.103 ms
I: singular boolean

Q: not (true or true)
A: False
T: 0.070 ms
I: singular boolean

Q: not (false or false)
A: True
T: 0.038 ms
I: singular boolean
3 Likes

Wow, it all makes sense now. :slight_smile:

Thanks for the help.

1 Like