QueryPolicy objects can be created in the Query Policies container, which is a child of the Directory Service container in the Configuration Directory Partition naming context.
LDAP setting | maximum value (hardcoded) |
---|---|
MaxReceiveBuffer | 20971520 |
MaxPageSize | 20000 |
MaxQueryDuration | 1200 |
MaxTempTableSize | 100000 |
MaxValRange | 5000 |
Therefore the effective setting for the above LDAP policy is MaxPageSize=50000 and MaxValRange=25000 on a Windows Server 2003 Domain Controller as configured in the LDAP policy in Active Directory but on a Windows Server 2008 R2 or Windows Server 2008 Domain Controller the hardcoded limits dictate MaxPageSize=20000 and MaxValRange=5000.
MaxValRange affects the number of attributes returned for a query. If you perform a SearchRequest for the multi-valued attribute Member for a group object with more than 5000 members the Windows Server 2008 R2 or Windows Server 2008 domain controller will only return 5000 of them.
The use of the Simple Paged Results Control maybe used to retrieve all the results.
There can be multiple queryPolicy objects in a AD Forest. A DC determines the queryPolicy object that contains its policies according to the following logic:
This is an export of the policy for a server. The "DC=mad,DC=example,DC=com" is AD DOMAIN and Windows Server Version dependent.
dn: CN=Default Query Policy,CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=mad,DC=example,DC=com objectClass: top objectClass: queryPolicy cn: Default Query Policy distinguishedName: CN=Default Query Policy,CN=Query-Policies,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=mad,DC=example,DC=com instanceType: 4 lDAPAdminLimits: MaxValRange=1500 lDAPAdminLimits: MaxReceiveBuffer=10485760 lDAPAdminLimits: MaxDatagramRecv=4096 lDAPAdminLimits: MaxPoolThreads=4 lDAPAdminLimits: MaxResultSetSize=262144 lDAPAdminLimits: MaxTempTableSize=10000 lDAPAdminLimits: MaxQueryDuration=120 lDAPAdminLimits: MaxPageSize=1000 lDAPAdminLimits: MaxNotificationPerConn=5 lDAPAdminLimits: MaxActiveQueries=20 lDAPAdminLimits: MaxConnIdleTime=900 lDAPAdminLimits: InitRecvTimeout=120 lDAPAdminLimits: MaxConnections=5000 name: Default Query Policy objectCategory: CN=Query-Policy,CN=Schema,CN=Configuration,DC=mad,DC=example,DC=com objectGUID:: 77+9V2dTeO+/vQtO77+9F......9fO+/vQ== showInAdvancedViewOnly: TRUE uSNChanged: 4124 uSNCreated: 4124 whenChanged: 20081213153904.0Z whenCreated: 20081213153904.0Z
To make sure that domain controllers can support service-level guarantees, you must specify operational limits for a number of LDAP operations. These limits prevent specific operations from adversely affecting the performance of the server, and also make the server more resilient to some types of attacks.
LDAP policies are implemented by using objects of the queryPolicy class. Query Policy objects can be created in the Query Policies container, which is a child of the Directory Service container in the configuration naming context. For example: cn=Query-Policies, cn=Directory Service, cn=Windows NT, cn=Services configuration naming context.
LDAP Query Result Size, MaxPageSize, is one common setting that people have problems.