DirectorySearch.PageSize = 2 doesn't work

Posted by Bero on Stack Overflow See other posts from Stack Overflow or by Bero
Published on 2011-01-14T16:25:01Z Indexed on 2011/01/14 16:53 UTC
Read the original article Hit count: 109

Filed under:
|
     using (DirectorySearcher srch = new DirectorySearcher(String.Format("(memberOf=  {0})",p_Target.DistinguishedName)))
     {
            srch.PageSize = 2;
            SearchResultCollection results = results = srch.FindAll();
            int count = results.Count;
     }

count = 3 (THREE) and not 2. Why is that? I don't want to have all results in just one page. I know that PageSize = 2 is silly small but I set that value in this case just for testing purpose (in reality it will be more).

© Stack Overflow or respective owner

Related posts about c#

Related posts about active-directory