---
title: Negative operators with advanced search
slug: device-management-apple/negative-operators-with-advanced-search
createdAt: 2026-10-06T07:47:34.860Z
---

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: 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:<br />- <font color="#323232">Home Country Name</font> as the field<br />- <font color="#323232">Does not equal</font> in <font color="#323232">Operator</font><br />- <font color="#323232">United States</font> in <font color="#323232">Country Name</font><br />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.<br />- Used only with strings.<br />- Available only in the expression field. | Select or enter:<br />- Go to <font color="#323232">Common Fields</font> and select <font color="#323232">Device Space</font>.<br />- In the expression field, enter:<br />does not contain<br />- Place the cursor between the two quote marks in the expression field and enter:<br /><font color="#323232">Global</font><br />The search returns a list of devices that are not assigned to the <font color="#323232">Global</font> 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.

**Procedure**

1. Go to <font color="#323232">Device &amp; Users &gt; Devices.</font>
2. Click the large magnifying glass icon located at the top right to initiate an advanced search.
3. In <font color="#323232">Field</font>, select <font color="#323232">Common Fields</font>.
4. Select <font color="#323232">Home Country Name</font>.
5. Select <font color="#323232">Does not equal</font> from the list in <font color="#323232">Operator</font>.
6. Select <font color="#323232">United States</font> from the list of countries in <font color="#323232">Country Name</font>.
7. Click <font color="#323232">Search</font>.
8. <font color="#323232">Optional\:</font> To save the search to a label, click <font color="#323232">Save to Label</font> 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](docId\:djNmPDRMftL3E6Of4emWR).

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.

**Procedure**

1. Go to <font color="#323232">Device &amp; Users</font> > <font color="#323232">Devices</font>
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 <font color="#323232">Search</font>.
5. <font color="#323232">Optional\:</font> To save the search to a label, click <font color="#323232">Save to Label</font> 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](docId\:djNmPDRMftL3E6Of4emWR).
