6 minute readApplies to: v3

How to use criteria when scoping objects

This article explains how to filter objects using advanced criteria when scoping a tile.

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.

Advanced Criteria

Useful operators

The table below shows some of the common operators and wildcards you can use when defining a criteria expression.

Operator Effect
= equals
!= does not equal
< less than
> greater than
LIKE simple pattern matching
% matches any number of characters when used with LIKE
_ matches any single character when used with LIKE
MATCHES full .net regular expression matching
AND test if two conditions are both true
OR test if either of two conditions are true

See the following Microsoft pages for more information on the syntax and a full list of and operators:

Criteria Expression Syntax

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 Name, not name; HealthState not Healthstate.

Useful properties for use in Criteria expressions include:

Property Name Values
Name The objects key properties, concatenated with a ;
HealthState HealthStates are:
0 = Unmonitored
1 = Healthy
2 = Warning
3 = Critical
IsAvailable 'true' or 1 if the object's parent health service is responding to SCOM, otherwise 'false' or 0 for objects that are offline/unmonitored
InMaintenanceMode 'true' or 1 if the object is in Maintenance mode, otherwise 'false' or 0

For example, in Scope > Advanced Criteria type:

HealthState = 1 in to show only healthy objects.

HealthState = 0 to show objects with unknown health state (uninitialized), a grey health state icon with a question mark.

HealthState IS NULL to show objects that are offline and with no known last health state value (uninitialized), a grey health state icon showing a power button.

To show ALL grey uninitialised objects (objects whose health state is either unmonitored/offline or unknown) use HealthState = 0 OR HealthState IS NULL

For more information about grey and other health states see Health state icons

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

There is no need to qualify the property with the type name such as [Microsoft.Windows.Computer]

Example Criteria

The following table provides you with some example filters that are commonly used by dashboard authors.

Objects you would like to see Criteria
Objects with particular text in their name DisplayName like '%Server1%'
Objects starting with a particular string DisplayName like 'test%'
All objects in maintenance mode InMaintenanceMode = 'TRUE'
All objects not in maintenance mode InMaintenanceMode != 'TRUE'
Objects that are not healthy HealthState != 1
Objects in critical state HealthState = 3
Objects in critical or warning state HealthState = 2 or HealthState = 3
Objects where the parent agent is offline IsAvailable='false'
Objects that are offline, in maintenance or state unknown IsAvailable='false' OR InMaintenanceMode=1 OR HealthState=0
Computers with a particular OS OSVersion = '6.3.9600'
List objects by name and filter by HealthState (Name like '%Server3%' OR Name like '%Server4%' OR Name like '%Server2%') AND HealthState=3
List objects by SCOM Id and filter by HealthState Id IN ('7021174b-9e5d-5fbf-878a-42b9f0bf6f4a', '9bd4a1cc-f07a-0e36-b37d-d9ee974e0f3c') AND HealthState=3
Exclude object from the Group specified DisplayName not like '%server3%'
Exclude objects from the Group specified (DisplayName NOT LIKE '%server3%') AND (DisplayName NOT LIKE '%server4%')

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

Advanced Criteria

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

How to use criteria when scoping alerts

Squared Up Ltd. (c) 2020Report an issue with this article