LDAP filter string for Active Directory Users and Computers "find" dialogue

Viewed 700

In Active Directory Users and Computers (ADUC), users can right-click an OU and select "Find" to search from all objects in the OU. On the first tab the user is presented with a "Name" and "Description" field to use for simple queries. However, the Name field appears to search against multiple fields in AD, such as canonicalName, sAMAccountName, and distinguishedName. I have not been able to find any documentation on MSDN that outlines a complete list of fields used when searching ADUC this way.

I am now writing a C# application, where one of the requirements is to search AD for an object. Since it it parsing user input, and different users favor different identifiers, the name of the object may be anything that would return the object using the find dialogue of ADUC. I am using a System.DirectoryServices.DirectorySearcher to achieve this, but I cannot seem to replicate the exact search behavior of ADUC.

Exactly which fields does the Name field of the ADUC "Find" dialogue query against, and what is the equivalent LDAP filter string?

1 Answers
Related