473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DirectoryServices - "The administrative limit for this request was exceeded"

Hello All, I was wondering wether anyone could help me
solve what is probably a very easy issue. I keep getting
this damn "The administrative limit for this request was
exceeded" whenever I try to query my LDAP server. Does
anyone have any idea how to fix this. I have tried the
pagesize and the sizelimit to no avail. Please help.
---
Here is my code below:
---
using System;
using System.DirectoryServices;

namespace Accounts_In_Out_C
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//int ppsize = 5;
///This is my attempt to create
code that will search a LDAP server
DirectoryEntry DirEnt = new
DirectoryEntry("LDAP://somecomputer:389/o=somecompany,
c=somecountry");
DirectorySearcher DirSrc = new
DirectorySearcher(DirEnt);
DirSrc.SearchScope =
SearchScope.Subtree;
DirSrc.ReferralChasing =
ReferralChasingOption.All;
//DirSrc.Filter = "(description =
*)";
DirSrc.SizeLimit = 1000000;
//DirSrc.PageSize = ppsize;
//Console.WriteLine
(DirSrc.PageSize);
try
{
foreach(SearchResult
result in DirSrc.FindAll())
{
DirectoryEntry
dirEntry = result.GetDirectoryEntry();

foreach(string
key in dirEntry.Properties.PropertyNames)
{
//Each
property contains a collection of its own
//that
may contain multiple values
foreach
(object propVal in dirEntry.Properties[key])
{
Console.WriteLine(key + " = " + propVal);

}
}
Console.WriteLine
("---------------");
}
}
catch(Exception ex)
{
Console.WriteLine
(ex.Message);
}

}
}
}
Nov 15 '05 #1
3 12297
Big Dave,

When you uncomment the assignment to the PageSize property, does it
work? From the section of the Platform SDK titled "Retreiving Large Result
Sets", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...sults_sets.asp

It states:

Many directory servers specify an Administrative Limit for the maximum
number of objects they can return if a client does not specify the page
size. When the Administrative Limit is reached, ADSI generates the
ERROR_DS_ADMIN_LIMIT_EXCEEDED Win32 error.

It looks like you are trying to get a good number of objects. You might
want to consider doing a paged search, and limiting the number of results
returned per page.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Big Dave" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
Hello All, I was wondering wether anyone could help me
solve what is probably a very easy issue. I keep getting
this damn "The administrative limit for this request was
exceeded" whenever I try to query my LDAP server. Does
anyone have any idea how to fix this. I have tried the
pagesize and the sizelimit to no avail. Please help.
---
Here is my code below:
---
using System;
using System.DirectoryServices;

namespace Accounts_In_Out_C
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//int ppsize = 5;
///This is my attempt to create
code that will search a LDAP server
DirectoryEntry DirEnt = new
DirectoryEntry("LDAP://somecomputer:389/o=somecompany,
c=somecountry");
DirectorySearcher DirSrc = new
DirectorySearcher(DirEnt);
DirSrc.SearchScope =
SearchScope.Subtree;
DirSrc.ReferralChasing =
ReferralChasingOption.All;
//DirSrc.Filter = "(description =
*)";
DirSrc.SizeLimit = 1000000;
//DirSrc.PageSize = ppsize;
//Console.WriteLine
(DirSrc.PageSize);
try
{
foreach(SearchResult
result in DirSrc.FindAll())
{
DirectoryEntry
dirEntry = result.GetDirectoryEntry();

foreach(string
key in dirEntry.Properties.PropertyNames)
{
//Each
property contains a collection of its own
//that
may contain multiple values
foreach
(object propVal in dirEntry.Properties[key])
{
Console.WriteLine(key + " = " + propVal);

}
}
Console.WriteLine
("---------------");
}
}
catch(Exception ex)
{
Console.WriteLine
(ex.Message);
}

}
}
}

Nov 15 '05 #2
Thanks, Nicholas,

Unfortunately when I uncomment out my pagesize code I get
the following error:

---
5
The value for the property PageSize could not be set.

---

Still don't know why I cant set it.

Dave
-----Original Message-----
Big Dave,

When you uncomment the assignment to the PageSize property, does itwork? From the section of the Platform SDK titled "Retreiving Large ResultSets", located at (watch for line wrap):

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/adsi/adsi/retrieving_large_results_sets.asp
It states:

Many directory servers specify an Administrative Limit for the maximumnumber of objects they can return if a client does not specify the pagesize. When the Administrative Limit is reached, ADSI generates theERROR_DS_ADMIN_LIMIT_EXCEEDED Win32 error.

It looks like you are trying to get a good number of objects. You mightwant to consider doing a paged search, and limiting the number of resultsreturned per page.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Big Dave" <an*******@discussions.microsoft.com> wrote in messagenews:09****************************@phx.gbl...
Hello All, I was wondering wether anyone could help me
solve what is probably a very easy issue. I keep getting this damn "The administrative limit for this request was exceeded" whenever I try to query my LDAP server. Does
anyone have any idea how to fix this. I have tried the
pagesize and the sizelimit to no avail. Please help.
---
Here is my code below:
---
using System;
using System.DirectoryServices;

namespace Accounts_In_Out_C
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//int ppsize = 5;
///This is my attempt to create
code that will search a LDAP server
DirectoryEntry DirEnt = new
DirectoryEntry("LDAP://somecomputer:389/o=somecompany,
c=somecountry");
DirectorySearcher DirSrc = new
DirectorySearcher(DirEnt);
DirSrc.SearchScope =
SearchScope.Subtree;
DirSrc.ReferralChasing =
ReferralChasingOption.All;
//DirSrc.Filter = "(description =
*)";
DirSrc.SizeLimit = 1000000;
//DirSrc.PageSize = ppsize;
//Console.WriteLine
(DirSrc.PageSize);
try
{
foreach(SearchResult
result in DirSrc.FindAll())
{
DirectoryEntry
dirEntry = result.GetDirectoryEntry();

foreach(string
key in dirEntry.Properties.PropertyNames)
{
//Each
property contains a collection of its own
//that
may contain multiple values
foreach
(object propVal in dirEntry.Properties[key])
{
Console.WriteLine(key + " = " + propVal);

}
}
Console.WriteLine
("---------------");
}
}
catch(Exception ex)
{
Console.WriteLine
(ex.Message);
}

}
}
}

.

Nov 15 '05 #3
Nothing wrong with the code, could it be that the ""Administrative Server
time limit" is set to a (too) low value for this (unrealistic) query?
What OS are you running on the AD server(s)?

Willy.

"Big Dave" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
Hello All, I was wondering wether anyone could help me
solve what is probably a very easy issue. I keep getting
this damn "The administrative limit for this request was
exceeded" whenever I try to query my LDAP server. Does
anyone have any idea how to fix this. I have tried the
pagesize and the sizelimit to no avail. Please help.
---
Here is my code below:
---
using System;
using System.DirectoryServices;

namespace Accounts_In_Out_C
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//int ppsize = 5;
///This is my attempt to create
code that will search a LDAP server
DirectoryEntry DirEnt = new
DirectoryEntry("LDAP://somecomputer:389/o=somecompany,
c=somecountry");
DirectorySearcher DirSrc = new
DirectorySearcher(DirEnt);
DirSrc.SearchScope =
SearchScope.Subtree;
DirSrc.ReferralChasing =
ReferralChasingOption.All;
//DirSrc.Filter = "(description =
*)";
DirSrc.SizeLimit = 1000000;
//DirSrc.PageSize = ppsize;
//Console.WriteLine
(DirSrc.PageSize);
try
{
foreach(SearchResult
result in DirSrc.FindAll())
{
DirectoryEntry
dirEntry = result.GetDirectoryEntry();

foreach(string
key in dirEntry.Properties.PropertyNames)
{
//Each
property contains a collection of its own
//that
may contain multiple values
foreach
(object propVal in dirEntry.Properties[key])
{
Console.WriteLine(key + " = " + propVal);

}
}
Console.WriteLine
("---------------");
}
}
catch(Exception ex)
{
Console.WriteLine
(ex.Message);
}

}
}
}

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
2
by: Lars | last post by:
I am trying to post a pretty long string (9300 bytes) in a hidden field and i get this very strange error message: Request object, ASP 0107 (0x800A01B8) The data being processed is over the...
0
by: mrwoopey | last post by:
Hi, My OLAP data cube is giving me the following error when I am manipulating OLAP data cube views: "the data being processed is over the allowed limit" I know that this message is caused by...
0
by: L-Soft list server at Sun Microsystems Inc. | last post by:
The distribution of your message dated Tue, 19 Aug 2003 19:52:31 --0500 with subject "Re: Thank you!" has been postponed because the daily message limit for the DEVELOPER-AUTORESPONDER list (9500)...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
0
by: dhnriverside | last post by:
Hi guys I want to find out which of my ActiveDirectory users is logged on to a particular ActiveDirectory Computer. I can get what Computer a user is logged on to with ...
2
by: TG | last post by:
I'm using the System.DirectoryServices.DirectorySearcher.Findall method to attempt to retrieve user id's from an Exchange LDAP server. I get the error message "The administrative limit for this...
0
by: Julien | last post by:
Hello I am now building an appli using the "System.DirectoryServices" namespace in order to retrieve particular data from my Active Directory I'd like to get the computer RDN of all the computers...
10
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.