組織の Active Directory でユーザーを検索しようとしています。
FirstNameまたはLastNameまたはDisplayName が特定の文字列値と一致する場合、ユーザーを返す必要があります。
私のコード:
// create your domain context
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
UserPrincipal qbeUser = new UserPrincipal(ctx);
qbeUser.GivenName = "Ramesh*";
// qbeUser.Surname = "Ramesh*";
// qbeUser.DisplayName= "Ramesh*";
PrincipalSearcher srch = new PrincipalSearcher(qbeUser);
// find all matches
foreach(var found in srch.FindAll())
{
//
}
問題は、1 つのフィルターでしか検索できないことです。
フィルターの AND はできますが、OR はできません。解決策はありますか?