DirectorySearcher.AttributeScopeQuery 속성

정의

검색할 고유 이름 특성의 LDAP 표시 이름을 가져오거나 설정합니다. 이 형식의 검색에는 특성을 하나만 사용할 수 있습니다.

public:
 property System::String ^ AttributeScopeQuery { System::String ^ get(); void set(System::String ^ value); };
public string AttributeScopeQuery { get; set; }
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.DirectoryServices.DSDescription("DSAttributeQuery")]
[System.Runtime.InteropServices.ComVisible(false)]
public string AttributeScopeQuery { get; set; }
[System.DirectoryServices.DSDescription("DSAttributeQuery")]
[System.Runtime.InteropServices.ComVisible(false)]
[System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public string AttributeScopeQuery { get; set; }
member this.AttributeScopeQuery : string with get, set
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
[<System.DirectoryServices.DSDescription("DSAttributeQuery")>]
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.AttributeScopeQuery : string with get, set
[<System.DirectoryServices.DSDescription("DSAttributeQuery")>]
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.ComponentModel.TypeConverter("System.Diagnostics.Design.StringValueConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
member this.AttributeScopeQuery : string with get, set
Public Property AttributeScopeQuery As String

속성 값

String

검색을 수행할 특성의 LDAP 표시 이름이거나, 특성 범위 쿼리가 설정되어 있지 않으면 빈 문자열입니다.

특성

예외

SearchScope 속성이 Base가 아닌 값으로 설정된 경우

예제

다음 예제에서는 멤버 특성과 함께 속성을 사용하여 AttributeScopeQuery 그룹의 멤버를 가져오는 방법을 보여 있습니다. 그런 다음 회원의 이름과 성 및 전화 번호를 출력합니다.

using System;
using System.DirectoryServices;  

public class Example
{
    public static void Main()
    {
        DirectoryEntry group = new DirectoryEntry("LDAP://CN=MyGroup", …);        
        DirectorySearcher src = new DirectorySearcher("(&(objectClass=user)(objectCategory=Person))");          
        src.AttributeScopeQuery = "member";  
        src.PropertiesToLoad.Add("sn");
        src.PropertiesToLoad.Add("givenName");  
        src.PropertiesToLoad.Add("telephoneNumber");  

        foreach(SearchResult res in src.FindAll())  
        {  
            Console.WriteLine("…");  
        }
    }
}

설명

이 속성이 설정된 특성은 멤버 또는 managedBy와 같은 고유 이름 특성이어야 합니다. 특성은 단일 또는 다중 값일 수 있습니다. 자세한 내용은 멤버Managed-By 문서를 참조하세요.

기본 개체의 특성에 지정된 고유 이름으로 식별되는 개체에 대해 검색이 수행됩니다. 예를 들어 기본 개체가 adschema 그룹 클래스이고 AttributeScopeQuery "member"로 설정된 경우 그룹의 멤버인 모든 개체에 대해 검색이 수행됩니다. 자세한 내용은 그룹 클래스 문서를 참조하세요.

AttributeScopeQuery 속성을 사용하는 SearchScope 경우 속성을 .로 Base설정해야 합니다. 속성이 SearchScope 다른 값으로 설정된 경우 속성을 설정 AttributeScopeQuery 하면 .ArgumentException

자세한 내용은 특성 범위 쿼리 수행을 참조하세요.

적용 대상