I am trying to retrieve 5000 users from AD group, but when I set PageSize= 1000 (or let's say 15000) and SizeLimit=15000, I still get only 1500 users. Any other configuration that I can set (I want to avoid range retrieval as suggested by MS) Please advice. Thanks Below is the code section: Please let me know what am I missing.
5 1957 - try
-
{
-
searcher.SizeLimit=15000;
-
searcher.PageSize = 1000;
-
return searcher.FindAll();
-
}
What is your full code? It appears you likely have a problem with the search string, assuming there really is 5000 users and not only 1500.
- private SearchResultCollection ExecuteBestEffortSearch(DirectorySearcher searcher)
-
{
-
if (searcher == null) { throw new ArgumentNullException("searcher"); }
-
if (searcher.SearchRoot == null) { throw new ArgumentException("Directory Searcher does not have a search root.", "searcher"); }
-
-
// Construct Search Message
-
string message = String.Format("[{0}] ({1}) with filter [{2}] for attributes [{3}]",
-
searcher.SearchRoot.Path, searcher.SearchScope, searcher.Filter, FlattenStringCollection(searcher.PropertiesToLoad));
-
-
// Execute Search
-
try
-
{
-
if (Logger.DebugLevel >= Logger.MaxDebugLevel)
-
{
-
Logger.Debug(0, "Executing directory search for " + message, null, DirectoryServiceException.ModuleName, Logger.MaxDebugLevel);
-
}
-
searcher.PageSize = 1000; //a positive number to turn off the default page limit in DirectorySearcher
-
return searcher.FindAll();
-
-
}
-
catch (COMException adsiException)
-
{
-
DirectoryServiceException dsExeception = DirectoryServiceException.Create(
-
String.Format("The directory search {0} was unable to execute due to a directory service error.", message), adsiException);
-
-
if (dsExeception is DirectoryServerUnavailableException)
-
{
-
try
-
{
-
Guid searchRootGuid = searcher.SearchRoot.Guid;
-
// Cleanup resources
-
searcher.SearchRoot.Dispose();
-
// Attempt to Re-Bind
-
using (DirectoryEntry searchRootEntry = GetEntryByGuid(searchRootGuid))
-
{
-
searcher.PageSize = 1000; //a positive number to turn off the default page limit in DirectorySearcher
-
searcher.SearchRoot = searchRootEntry;
-
return searcher.FindAll();
-
}
-
}
-
catch (Exception ex)
-
{
-
Logger.LogError(30019, String.Format("The directory search {0} failed because the search root was unavailable and the server was not able to establish a new bind.", message), ex, DirectoryServiceException.ModuleName, Logger.MinDebugLevel);
-
}
-
}
-
throw dsExeception;
-
}
-
}
And SizeLimit i am defining when i create an object of DirectorySearcher class
I'm still not seeing in your code where you supply a search filter to only grab user objects.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Betty Harvey |
last post by:
The next meeting of the XML Users Group will be held on Wednesday,
August 20, 2003 at the American Geophysical Union (AGU) at 2000
Florida Avenue, N.W., Washington, DC 20009-1277. The meeting...
|
by: Betty Harvey |
last post by:
The next meeting of the XML Users Group will be held on Wednesday,
September 17, 2003 at the American Geophysical Union (AGU) at 2000
Florida Avenue, N.W., Washington, DC 20009-1277. The meeting...
|
by: Betty Harvey |
last post by:
The next meeting of the XML Users Group will be held on Wednesday,
October 15, 2003 at the American Geophysical Union (AGU) at 2000
Florida Avenue, N.W., Washington, DC 20009-1277. The meeting...
|
by: Betty Harvey |
last post by:
The next meeting of the XML Users Group will be held on Wednesday,
November 19, 2003 at the American Geophysical Union (AGU) at 2000
Florida Avenue, N.W., Washington, DC 20009-1277. The meeting...
|
by: Betty Harvey |
last post by:
Happy 2004! I hope everyone had a great holiday and will have a
good new year.
The next meeting of the XML Users Group will be held on Wednesday,
January 21, 2004 at the American Geophysical...
| |
by: info |
last post by:
Philadelphia XML Users' Group
NEXT MEETING: May 11th, 6:00 to 8:00 pm
Update from the Philadelphia XML Users' Group
The Users' Group is an open organization that invites participation
from...
|
by: Betty Harvey |
last post by:
NOTE: This is the last meeting of 2006!!
The next meeting of the XML Users Group will be held on Wednesday,
November 15, 2006 at the American Geophysical Union (AGU) at 2000
Florida Avenue,...
|
by: Jamunt |
last post by:
Hi,
I want to create an application in which around 1000 users will be
served at one time. All of the users will be sending around 1 mb of
data. I will be parsing that data and would insert some...
|
by: Betty Harvey |
last post by:
The next meeting of the XML Users Group will be held on Wednesday,
March 21, 2006 at the American Geophysical Union (AGU) at 2000
Florida Avenue, N.W., Washington, DC 20009-1277. The meeting starts...
|
by: =?Utf-8?B?V2lsbWVyIEhlcm5hbmRleg==?= |
last post by:
An ActiveX component created using ATL under Visual Studio 2003, and it is
used in a ASP, runs perfectly under administrator or power users group,
however this same object does not run under the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |