Simple Relevance Question - Model Number = "String"

(imported topic written by SystemAdmin)

I want to run a simple relevance statement to say if a mode number equals a specific model, make it relevant…What am I doing wrong, I keep getting “False” below are two examples…

Example 1:

q: if (exists wmi) then (string value of select “Model from Win32_ComputerSystem” of wmi) else (“N/A”)

A: PowerEdge 2650

q: (if (exists wmi) then (string value of select “Model from Win32_ComputerSystem” of wmi) else (“N/A”)) = “PowerEdge 2650”

A: False

Example 2:

q: string value of select “Model from Win32_ComputerSystem” of wmi as string

A: PowerEdge 2650

q: string value of select “Model from Win32_ComputerSystem” of wmi as string = “PowerEdge 2650”

A: False

(imported comment written by BenKus)

Hey mboseck,

I think if you look at your result, you will see that it has a number of trailing spaces (some WMI queries for hardware return extraneous spaces)…

Try this:

q: string value of select “Model from Win32_ComputerSystem” of wmi as string as trimmed string = “PowerEdge 2650”

Ben

(imported comment written by SystemAdmin)

Awesome Ben, that was it, and the as trimmed string worked!!! Thanks for the quick response