Singular expression refers to non-unique object

(imported topic written by Rominal91)

When I use this relevance for Managed computer properties,

string value of select “SMBIOSAssettag from Win32_systemenclosure” of wmi

I get the correct info on some machines but other we get the error “Singular expression refers to non-unique object” along with the asset value we are trying to get. So on the Console view it just shows as multiple results;error. How do we fixit?

(imported comment written by NoahSalzman)

Try

string values of selects …

We should expand that error message to read “… try throwing some esses on a few nouns of your relevance expression and see what happens” :slight_smile:

(imported comment written by Rominal91)

Thanks, that helped to some degree. We don’t get the error instead we get a blank line. And also in the console it still shows multiple results. We look mostly at the console so we still need some help with it.

(imported comment written by Rominal91)

Thanks, that helped to some degree. We don’t get the error instead we get a blank line. And also in the console it still shows multiple results. We look mostly at the console so we still need some help with it.

(imported comment written by jessewk)

string values of select “SMBIOSAssettag from Win32_systemenclosure” of wmi

–> will be blank if there are no results returned by the WMI query

–> will have one or more results if there is at least one value returned by the WMI query

string value of select “SMBIOSAssettag from Win32_systemenclosure” of wmi

–> will return ‘singular expression refers to non-existant object’ if there are zero values returned by the query

–> will return one value if there is exactly one value returned by the query

–> will return ‘singular expression refers to non-unique object’ if there is more than one value returned by the query

Note that the only difference between those expressions is that ‘string values’ is pluralized.

It sound like the machine you are testing on returns 0 values for the query, but you also have machines in your environment that return more than one value when they run that query.

That’s a long way of saying, you should update the definition of your retrieved property in the console to use the expression Noah posted. You should see the errors go away, except on machines that have WMI disabled. To guard agains that, use this expression:

if (exists wmi) then string values of select “SMBIOSAssettag from Win32_systemenclosure” of wmi else “N/A”

Jesse

(imported comment written by Rominal91)

Thanks again, I will try that and let you know the results.