与えられたOUの中に与えられたGuid
のコンピュータが存在するかどうかを調べる必要があります。"Query By Example"でGuidを検索することはできますか?
これを行うには、Guid
に一致するコンピュータを検索するQuery By Exampleと書いてください。たとえば:ComputerPrincipal.Guid
フィールドは読み取り専用であるため、
PrincipalContext context = new PrincipalContext(ContextType.Domain, domain, container);
ComputerPrincipal computer = new ComputerPrincipal(context);
computer.Guid = guidToMatch;
PrincipalSearcher searcher = new PrincipalSearcher(computer);
// Get the computer if it exists...
はもちろん、これは、動作しません。さらに、ComputerPrincipal.AdvancedSearchFilter
にはGuid
フィールドが含まれていません。
これが可能ですか、とにかく(もっと良い選択肢のように)これをやりたくない理由がありますか?