Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
July 20, 2005
An ordinary domain user can join 10 members to the domain by default.
Using ADFind.exe freeware and ADMod.exe freeware, I have scripted MachineAccountQuota.bat to alter the default.
The syntax for using MachineAccountQuota.bat is:
call MachineAccountQuota Number
Where Number is the new limit for the DNS domain you are logged onto.
NOTE: MachineAccountQuota.bat uses Numeric.bat, MachineAccountQuota.bat contains:
@echo offsetlocalif {%1}=={} goto errset work=%1set work=%work:"=%call Numeric %work% OKif "%OK%" EQU "N" goto errif "%work%" EQU "0" goto OKif "%work:~0,1%" EQU "0" goto errset /a Number=%work%call :getDomainDNS>nul 2>&1if "%dn%" EQU "NONE" goto errcall :putDomainDNS>nul 2>&1endlocalgoto :EOF:getDomainDNSset dn=NONEfor /f "Tokens=1* Delims=:" %%a in ('adfind -default -f "objectClass=DomainDNS" -nodn -noctl distinguishedName^|find /i "distinguishedName"') do ( set dn=%%b)if "%dn%" EQU "NONE" goto :EOFset dn=%dn:~1%goto :EOF:putDomainDNSadmod -b %dn% "ms-DS-MachineAccountQuota::%Number%"goto :EOF:err@echo Syntax: MachineAccountQuota Numberendlocal
You May Also Like