Relevance for custom property containing specific value

(imported topic written by daveb91)

I have a property created via the “Location Property” wizard. The property name is “LocationName”. I wish to query the system for the names of computers that have a particular value of this property:

Desired output: a list of computer names where LocationName contains the letter “B” (should be >2000)

Now, I know that not all of the computers have set this value yet, or successfully. Most have good values, but I have some systems reporting an error, , etc. I know I need to test “exists” but can’t quite get the swing of it.

Following another thread, here’s what I’ve tried:

exists bes property “LocationName”

True

exists results (bes property “LocationName”, bes computers)

True

number of computers of results (bes property “LocationName”, bes computers)

12310

number of values of results (bes property “LocationName”, bes computers)

11908

It’s easier to recognize a return value of zero than an empty result set, so I started by looking for the number. Here’s one I thought was close, no error messages though it takes a long time, but it always evaluates to zero (0):

number of bes computers whose (value of (result of (bes property “LocationName”)) contains “B”)

Any pointers?

(imported comment written by SystemAdmin)

Try this one:

number of computers of results whose (exists values whose (it contains 
"B") of it) of BES Property 
"LocationName"

(imported comment written by daveb91)

Perfect! Thanks so much.