How to use criteria when scoping objects
This article explains how to filter objects using advanced criteria when scoping a tile.
For more information about the basic scoping options see How to scope tiles.
For information about scoping alerts see How to use criteria when scoping alerts.
Scope Criteria
When configuring the scope of a tile, the Criteria option under Scope > Advanced allows you to more precisely filter objects displayed in the tile by creating a specific expression to refine data returned from SCOM.
For example, Name LIKE '%server%'
would return all objects with server
in their key properties.
Useful operators
The table below shows some of the common operators and wildcards you can use when defining a criteria expression.
See the following Microsoft pages for more information about the syntax and a full list of and operators:
Object Properties
The property names use the SCOM internal name, not the display name, and the property names are case sensitive, i.e. it must be DisplayName, not displayname; HealthState not Healthstate. There is no need to qualify the property with the type name such as [Microsoft.Windows.Computer]
For a list of generic property names valid for all objects see MonitoringObject Properties.
To get a full list for a particular object you can also run the following PowerShell script:
Get-SCOMClassInstance -Name "hostname.dnsdomain" | Format-List
Replacing hostname.dnsdomain with your details, for example, server1.domain.local
Useful properties
For example, in Scope > Advanced Criteria type the following to show all healthy objects:
HealthState = 1
Null
Some properties may be blank, or have no value, in SCOM. For example, computers that have not yet had a health state, or not ever been put into Maintenance mode. To show objects with a blank value you must use IS null
or IS NOT null
.
When using null
you must use IS null
or IS NOT null
, it will not work with operators such as = null
.
To show ALL gray uninitialised objects:
HealthState IS NULL OR HealthState = 0
To show computers that are not in Maintenance Mode use:
InMaintenanceMode IS NULL OR InMaintenanceMode = 'false'
Example Criteria
The following table provides you with some example filters that are commonly used by dashboard authors.
List Objects by Name
To specify a list of objects by Name you should specify their Class and the following Criteria:
Name like '%Server3%' OR Name like '%Server4%' OR Name like '%Server2%'
You can filter the list by adding to the Criteria (for example, objects from a list that must also be showing as critical):
(Name like '%Server3%' OR Name like '%Server4%' OR Name like '%Server2%') AND HealthState=3
List Objects by Id
To specify a list of objects by SCOM Id you should use a Class and the following Criteria:
Id IN ('7021174b-9e5d-5fbf-878a-42b9f0bf6f4a', '9bd4a1cc-f07a-0e36-b37d-d9ee974e0f3c')
You can filter the list by adding to the Criteria (for example, objects from a list that must also be showing as critical):
Id IN ('7021174b-9e5d-5fbf-878a-42b9f0bf6f4a', '9bd4a1cc-f07a-0e36-b37d-d9ee974e0f3c') AND HealthState=3
See How to find the SCOM ID of an object or group to determine the Id of an object.
Alternatively you can create a group in SCOM containing the objects you have previously been listing, and then use the Group option.
Hide unmonitored objects
You can hide objects that are unmonitored from being displayed by using the not equals operator and the HealthState property:
HealthState != 0
Mustache editor
In SquaredUp DS v4.7 and above you can use the mustache editor with Criteria on perspectives.
For example, on a perspective you can insert the {{displayName}} of the object being viewed.
Clicking the {{}} button or typing {{
brings up a helpful picker which shows all the properties of your selected objects, along with sample values.
Once the mustache helper is displayed, the list of properties will automatically filter based on what you type, allowing you to quickly find a property using a partial name or likely term. Clicking an item in the list will automatically insert that property and complete the mustache.
Property names are case-sensitive and should be written as they appear in the mustache helper (e.g. displayName
not DisplayName
).
The mustache helper button will only show when viewing the Criteria field on a perspective. This is because mustaches are processed against the perspective object not the scope objects.