DirectorySearcher.AttributeScopeQuery プロパティ
メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。
検索対象とする識別名の属性の LDAP 表示名を取得または設定します。この種類の検索では 1 つの属性だけを使用できます。
名前空間: System.DirectoryServices
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文
Dim instance As DirectorySearcher Dim value As String value = instance.AttributeScopeQuery instance.AttributeScopeQuery = value
[ComVisibleAttribute(false)] public: property String^ AttributeScopeQuery { String^ get (); void set (String^ value); }
/** @property */ public String get_AttributeScopeQuery () /** @property */ public void set_AttributeScopeQuery (String value)
public function get AttributeScopeQuery () : String public function set AttributeScopeQuery (value : String)
プロパティ値
検索の実行対象となる属性の LDAP 表示名。または属性のスコープのクエリが設定されていない場合は空の文字列。


このプロパティに設定する属性は、member や managedBy などの識別名属性である必要があります。この属性には、単一の値または複数の値を設定できます。詳細については、MSDN ライブラリ (http://msdn.microsoft.com/library) で、adschema に関するトピック「Member」および「Managed-By」を参照してください。
ベース オブジェクトの属性で指定される識別名で識別されるオブジェクトに対して検索が実行されます。たとえば、ベース オブジェクトが adschema グループ クラスであり、AttributeScopeQuery が "member" に設定されている場合、グループのメンバであるすべてのオブジェクトに対して検索が実行されます。詳細については、MSDN ライブラリ (http://msdn.microsoft.com/library/ja) で adschema の "Group" クラスのトピックを参照してください。
AttributeScopeQuery プロパティが使用される場合、SearchScope プロパティは Base に設定される必要があります。SearchScope プロパティが他のいずれかの値に設定された場合、AttributeScopeQuery プロパティを設定すると ArgumentException がスローされます。
詳細については、MSDN ライブラリ (http://msdn.microsoft.com/library) の「Performing an Attribute Scope Query」を参照してください。

member 属性を指定して AttributeScopeQuery プロパティを使用し、グループのメンバを取得する方法を次のコード例に示します。この例では、メンバの姓名、およびそれらの電話番号が出力されます。
using System.DirectoryServices; DirectoryEntry group = new DirectoryEntry("LDAP://CN=MyGroup, …"); DirectorySearcher src = new DirectorySearcher(group "(&(objectClass=user)(objectCategory=Person))"); src.AttributeScopedQuery = "member"; src.PropertiesToLoad = new string[] {"sn","givenName", "telephoneNumber"}; foreach(SearchResult res in src.FindAll()) { Console.WriteLine("…"); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDirectorySearcher.AttributeScopeQuery プロパティを検索する場合は、下記のリンクをクリックしてください。

- DirectorySearcher.AttributeScopeQuery プロパティのページへのリンク