Negative operators with advanced search

Using negative operators enables you to create filters that exclude devices instead of including them. For example, you can search for:

  • Devices that use any platform other than iOS
  • Devices with a current country code other than US
Table 15.   Negative operators with advanced search

Operator

Action

Example

Does not equal

Returns a list of devices that do not match the criteria specified in the value field for the selected field.

Select:

Home Country Name as the field

Does not equal in Operator

United States in Country Name

The search returns a list of devices that do not have United States as their home country name.

Does not contain

Returns a list of devices that do not contain the string specified in the selected field.

Used only with strings.

Available only in the expression field.

Select or enter:

Go to Common Fields and select Device Space.

In the expression field, enter:
does not contain

Place the cursor between the two quote marks in the expression field and enter:
Global

The search returns a list of devices that are not assigned to the Global space.

Examples for advanced search with negative operators

To display a list of devices that have countries other than the United States as the assigned home country, create an advanced search expression that provides the necessary information.

  1. Go to Device & Users > Devices.
  2. Click the large magnifying glass icon located at the top right to initiate an advanced search.
  3. In Field, select Common Fields.
  4. Select Home Country Name.
  5. Select Does not equal from the list in Operator.
  6. Select United States from the list of countries in Country Name.
  7. Click Search.
  8. Optional: To save the search to a label, click Save to Label and then provide an existing label name or a new label name and description.
  9. If Notes for Audit Logs is enabled, a text dialog box opens. Enter the reason for the change and then click Confirm. For more information, see Best practices: label management.

Suppose you want to list users within an LDAP group that have a Home Country Code other than the United States (US).

To create the advanced search expression that provides the needed list:

  1. Go to Device & Users > Devices
  2. Click the large magnifying glass icon located at the top right to initiate an advanced search.
  3. In the expression field enter the following, including quote marks:

    “user.ldap.groups.name” = “Corp_Users” AND “common.home_country_code” != “US”

  4. Click Search.
  5. Optional: To save the search to a label, click Save to Label and then provide a new label name and description.
  6. If Notes for Audit Logs is enabled, a text dialog box opens. Enter the reason for the change and then click Confirm. For more information, see Best practices: label management.