DirectorySearcher.AttributeScopeQuery プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DirectorySearcher.AttributeScopeQuery プロパティの意味・解説 

DirectorySearcher.AttributeScopeQuery プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

検索対象とする識別名の属性の LDAP 表示名を取得または設定します。この種類の検索では 1 つの属性だけを使用できます。

名前空間: System.DirectoryServices
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)
構文構文

<ComVisibleAttribute(False)> _
Public Property AttributeScopeQuery As
 String
Dim instance As DirectorySearcher
Dim value As String

value = instance.AttributeScopeQuery

instance.AttributeScopeQuery = value
[ComVisibleAttribute(false)] 
public string AttributeScopeQuery { get;
 set; }
[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 表示名。または属性のスコープのクエリが設定されていない場合は空の文字列。

例外例外
例外の種類条件

ArgumentException

SearchScope プロパティは、Base 以外の値に設定されています。

解説解説

このプロパティに設定する属性は、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("…");
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

DirectorySearcher.AttributeScopeQuery プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DirectorySearcher.AttributeScopeQuery プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS