Finding Objects by Name
Most objects in Active Directory Domain Services use the cn property as their naming attribute. Some objects, however, use a naming attribute other than cn. For example, a domain controller uses the domainDNS property for the naming attribute and an organizational unit uses the organizationalUnit property for the naming attribute. To avoid having to use a different naming attribute for different object types, the name property, which contains the relative distinguished name of the object, should be used to search for objects by name.
The following code examples show different query strings that can be used to find objects by name.
The following query string finds all objects with a name that begins with "Jeff".
The following query string finds all computer objects with a name that begins with "leased" or "corp".
The following query string finds all users and with a name that begins with "Karen" or "Jeff".