I'm trying to retrieve a set of records from Active Directory using Query by Example. This snippet will find any records with the name of "John Smith":
PrincipalContext context = new PrincipalContext(ContextType.Domain, contextName);
User filter = new User(context);
var users = new List<User>();
filter.LastName = "Smith";
filter.GivenName = "John";
PrincipalSearchResult<Principal> matches = null;
PrincipalSearcher searcher = new PrincipalSearcher(filter);
matches = searcher.FindAll() as PrincipalSearchResult<Principal>;
but I want to apply these filters so I can match any record with a last name of "Smith" or a given name of "John", e.g. "Mary Smith", "John Brown". Is this possible using Query by Example - without having to run multiple searches? I haven't been able to find any documented examples.