DirectorySearcher.PageSize Property
Assembly: System.DirectoryServices (in system.directoryservices.dll)
Windows 98, Windows Server 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
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.There is a delicate balance between PageSize and SizeLimit.
That is, if you don't set PageSize then you will only get 1000 results, not matter how many results there are.
Counterintuitively, increasing the SizeLimit doesn't help - instead, you should set the PageSize to be 1000. This is the only change you need to make.
The reason for this, is that SizeLimit limits the amount of results that you can retrieve at once - so your PageSize needs to be less than or equal to this. The paging is done automagically behind the scenes when you call FindAll() etc.
- 6/28/2006
- ShaunMcCarthy
