Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


November 07, 2006

How can I set the maximum page size supported for LDAP responses in my domain?

RSS
Subscribe to Windows IT Pro | See More Domains Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

10975 » How can I set the maximum page size supported for LDAP responses in my domain? (07-Nov-06)

The maximum number of responses to an LDAP query (MaxPageSize) defaults to 1000.

I have scripted MxPgSz.bat to set the MaxPageSize to a value that you specify.

The syntax for using MxPgSz is:

[call] MxPgSz DC SZ

Where:

DC is the domain controller that you wish to connect to, generally the PDC emulator, like JSI001.

SZ is the MaxPageSize value that you wish to set, like 2000.
NOTE: MxPgSz.bat uses the NTDSutil.exe tool.

MxPgSz.bat contains:

@echo off
setlocal
if exist "%TEMP%\MxPgSz.TMP" del /q /f "%TEMP%\MxPgSz.TMP"
if {%2}=={} goto err
setlocal
set DC=%1
set DC=%DC:"=%
set OK=N
for /f "Tokens=*" %%a in ('ping -n 1 %DC%^|FIND "TTL="') do set OK=Y
if "%OK%" EQU "N" goto err1
set SZ=%2
set SZ=%SZ:"=%
@echo %SZ%|findStr "[^0-9]">nul
if %ERRORLEVEL% EQU 0 goto err2
set OK=N
call :quiet  >"%TEMP%\MxPgSz.TMP" 2>&1
for /f "Tokens=1* Delims=(" %%a in ('type "%TEMP%\MxPgSz.TMP"^|FIND "MaxPageSize"') do (
 if "%%b" NEQ "" set OK=Y
)
if exist "%TEMP%\MxPgSz.TMP" del /q /f "%TEMP%\MxPgSz.TMP"
if "%OK%" EQU "N" goto err3
endlocal
goto :EOF
:quiet
ntdsutil "l p" con "co t s %DC%" q "set MaxPageSize to %SZ%" "Sh V" "com ch" q q
goto :EOF
:err
@echo Syntax: MxPgSz DC SZ
endlocal
goto :EOF
:err1
@echo Syntax: MxPgSz DC SZ - %DC% not found.
endlocal
goto :EOF
:err2
@echo Syntax: MxPgSz DC SZ - %SZ% is not numeric.
endlocal
goto :EOF
:err3
@echo Syntax: MxPgSz %DC% %SZ% - failed to update.
endlocal


End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 24, 2008

An often irreverent look at some of the week's other news, including a Vista Capable dismissal request, Zune price reductions, Morrow musings, Novell and Microsoft sitting in a tree ... two years later, Yahoo!, IE 6 on Windows Mobile, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...


Related Events Check out our list of Free Email Newsletters!

Related Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing