2017-05-22 5 views
0

내 .net 핵심 프로젝트에서 novell.directory.ldap.netstandard를 사용하여 활성 디렉토리를 쿼리하고 있습니다.novell.directory.ldap.netstandard MaxResults

서버의 PageSize가 1000으로 설정되어 있기 때문에 최대 1000 명의 사용자를 다시 불러오고 있습니다. 어떻게 모든 활성 디렉토리 사용자를 다시 불러 오도록 코드를 가져올 수 있습니까? - 비동기 검색 방법을 사용하고 있습니다.

 string ldapHost = ""; 
     int ldapPort = ; 
     string loginDN = ""; 
     string password = ""; 
     string searchBase = ""; 
     string searchFilter = ""; 
     string[] attributes = new string[] { "givenName", "sn"}; 

     LdapConnection ldapConn = new LdapConnection(); 

     ldapConn.Connect(ldapHost, ldapPort); 

     ldapConn.Bind(loginDN, password); 

     LdapSearchQueue queue = ldapConn.Search(searchBase, LdapConnection.SCOPE_SUB, searchFilter, attributes, false, (LdapSearchQueue)null, (LdapSearchConstraints)null); 

     LdapMessage message; 
     int i = 1; 

     while ((message = queue.getResponse()) != null) 
     { 
      if (message is LdapSearchResult) 
      { 
       LdapEntry entry = ((LdapSearchResult)message).Entry; 

       LdapAttributeSet attributeSet = entry.getAttributeSet(); 

       Console.WriteLine(i + " " + attributeSet.getAttribute("givenName")?.StringValue + " " + attributeSet.getAttribute("sn")?.StringValue); 
       i++; 
      } 
     } 

     ldapConn.Disconnect(); 

답변

0

LDAP 용어로 페이지 결과 컨트롤을 사용해야합니다. C#에서

,이 질문은 그것을 커버 것 : 나는 새로운 프로젝트를 생성 아직 .NET의 핵심에서 사용할 수있는 기존 .NET 프레임 워크하지만 DirectorySearcher 밤은을 대상으로 할 때 나는 그것이 DirectorySearcher를 사용하여 작업을 얻을 수 https://stackoverflow.com/a/90668/7990687

+0

을 그래서 그것을 할 방법을 찾을 수 없으므로 제 문제를 일으키는 타사 라이브러리를 사용해야합니다. –

+0

VLV (가상 목록보기)를 사용하여 해결 방법을 관리 할 수 ​​있습니다.이 컨트롤은 새로운 라이브러리에서 사용할 수없는 것 같습니다. https://www.novell.com/coolsolutions/feature/11204.html#5.1 컨트롤,하지만 그것은 내 knowledges입니다 : / – Esteban