An LDAP Query targeting item allows a preference item to be applied to computers or users only if the LDAP query returns a value for the attribute specified in the targeting item. If Is Not is selected, it allows the preference item to be applied only if the LDAP query does not return a value for the attribute specified in the targeting item.

Filter

The LDAP search used by the targeting item. All subcontainers are searched. If you want to search for a non-container object, leave this box blank and specify the full location to the non-container object in the Bindings box. Providing this value in the targeting item is optional.

Example:

This LDAP filter finds all users with last names that start with the letter A.
(&(objectClass=user)(sn= A*))

Binding

The path for a container in which the search is performed. The object must be a container if a Filter is specified, or an error occurs. If the Binding cannot be satisfied, an error results.

Note

Binding prefixes are case sensitive and must be in upper case (LDAP).

Example:

  • This example binds to the root of the namespace.
    LDAP:

  • This example binds to the root of the Global Catalog.
    GC:

  • This example binds to a specific server.
    LDAP://servername

  • This example binds to a specific container by its distinguished name.
    LDAP://CN=LabUser1,OU=LAB,DC=contoso,DC=com

Attribute

The specified attribute value returned from the search. Providing this value in the targeting item is optional.

Example:

This example shows how to specify the canonical name attribute.
cn

Environment variable name

The name of the environment variable to which the targeting item sets the value of the Attribute, if one is found. Providing this value in the targeting item is optional.

Important

This option supports only the following Active Directory data types. Other data types may succeed but return empty values.
ADSTYPE_DN_STRING
ADSTYPE_CASE_EXACT_STRING
ADSTYPE_CASE_IGNORE_STRING
ADSTYPE_PRINTABLE_STRING
ADSTYPE_NUMERIC_STRING
ADSTYPE_OBJECT_CLASS
ADSTYPE_BOOLEAN

Note

If the returned attribute value is a multivalued attribute, the first item in the list of values is assigned to the environment variable.

Additional considerations

  • To reposition a targeting item within the list of targeting items that you have applied to a preference item, either drag the targeting item to a new position, or select the targeting item and then click the Move Up arrow or Move Down arrow.

  • Preference items are available only in domain-based GPOs.

  • LDAP Query targeting items use the subtree search option.

  • LDAP Query targeting items do not chase referrals.

Additional references