Relevance to test computer models finds nothing

(imported topic written by SystemAdmin)

I added a relevance to a fixlet to select certain Dell computer models. It works as expected in relevance debugger, but nothing is applicable to the fixlet.

((it contains "latitude e") or (it contains "optiplex" and exists numeric value of it and numeric value of it >= 745)) of (string values of selects "Name from Win32_ComputerSystemProduct" of wmi as trimmed string as lowercase)

Did I mess the syntax? Or is there an important difference between using WMI in relevance debugger and bes client?

more details:

The original fixlet has 2 relevances:

exists (name of operating system as lowercase) whose (it contains "winxp" or it contains "win7")

not exists key "HKEY_LOCAL_MACHINE\SOFTWARE\..." of registry

I made a copy of the fixlet and added the 3rd (WMI) relevance, no other changes.

Original fixlet has almost 500 applicable. Approx 150 of those should be applicable to the copy fixlet and have been active since I created it.

(imported comment written by NoahSalzman)

I would try and simplify to figure out where things are breaking down.

Run this on the same set of machines and see what comes back:

string values of selects "Name from Win32_ComputerSystemProduct" of wmi as trimmed string as lowercase)

And to answer your question, yes, the debugger does run things differently than the agent on the endpoint. You can make the debugger behave the same as the agent by choosing “Evaluate Using -> Local Client Evaluator” (see attached image).

(imported comment written by NoahSalzman)

And now without the stray parentheses:

string values of selects "Name from Win32_ComputerSystemProduct" of wmi as trimmed string as lowercase

(imported comment written by SystemAdmin)

Thanks, Noah. I didn’t notice the local client evaluator option - though it explains why the BES Client API Tester hasn’t been updated.

While I was experimenting I noticed that the result type was plural boolean.

“string values of selects…” is plural string, the resulting test is plural boolean

I changed to “string value of select…” to get singular boolean, it looks like it’s working now.

(imported comment written by SystemAdmin)

That’s probably bad form, though. I’m assuming a singular WMI call will get the result I want. Which it probably will, but it’s not good practice to discard plurality.

Anyone know how I can get a singular boolean evaluating a plural string?

(imported comment written by NoahSalzman)

You could concatenate the string and then check to see if it contains what you are looking for. Or, you can put the “where” logic in the WMI query itself.

(imported comment written by SystemAdmin)

Perfect!

“concatenation of string values of selects…”

I don’t know SQL well, so I’d rather not put things I might have to troubleshoot into the WMI query. (The WMI query is SQL, right?)

(imported comment written by NoahSalzman)

It’s a subset of SQL.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa394552(v=vs.85).aspx