GrupoITPro
Comunidad ITPro

Limite en las consultas LDAP

Es muy común es hacer algún tipo de scripts donde nos encontremos que al hacer la consulta LDAP de algún objeto de AD como usuarios, membrecía de grupos, o una consulta general de LDAD esta tiene un límite de 1000 objetos en la respuesta.

Este límite esta dado por cuestiones de performance de AD para no impactar al momento de responder. Pero en muchos casos es un problema

Las directivas LDAP se implementan mediante objetos de la clase queryPolicy. Los objetos de directiva de consulta pueden crearse en el contenedor Directivas de consulta, que es un elemento secundario del contenedor Servicio de directorio del contexto de nomenclatura de configuración.

El valor MaxPageSize del atributo LDAPAdminLimits controla el número de registros que pueden devolverse en una consulta LDAP.
Por defecto el valor de MaxPageSize es de 1000 registros..

Para ver los valores de las políticas LDAP deben hacerlo por medio de Ntdsutil

Hacemos inicio,
ejecutar CMD
Ntdsutil
LDAP policies
connections
connect to server
q
Show Values


Y para cambiarlo, a modo de ejemplo a 2500, debemos usar la sentencia  

Set MaxPageSize to 2500
Commit Changes



Nota: La Herramienta Microsoft Exchange Server Analyzer nos mostrara una advertencia en caso que sea superior a 2500
How to view and set LDAP policy in Active Directory by using Ntdsutil.exe

 


Posted Jun 18 2008, 02:24 PM by gustavog
Filed under:

Comments

Marcelo P. di Iorio wrote re: Limite en las consultas LDAP
on 06-19-2008 2:26 PM

Ojo, no es conveniente incrementar así por que sí este valor. De acuerdo con MS, en casos como este se recomienda usar Paged Searches.

Fragmento:

If this value is increased, be aware that the load to the client and server also increases. At some point increasing the value may cause a DC to fail to respond to queries, database operations may fail, replication may be interrupted, and database fragmentation may be increased.

Paged searches provide the following benefits:

Fewer resources required on both the client and LDAP server.

The client is more responsive because it only has to receive a page at a time instead of the entire large result all at one time.

The client can abandon the search before completion.

Most customers who change this value do so because they are unaware that the better and correct solution is to utilize a paged search control. They may also not want to go through the effort of rewriting code or having their vendor rewrite code. Applications that do not support paged searches are poorly written (or are very old) and should be avoided.

Saludos.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Powered by Community Server (Commercial Edition), by Telligent Systems