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 27, 2006
Using Nltest.exe from the Support Tools, I have scripted DCSites.bat to return the list of sites that a DC covers.
The syntax for using DCSites.bat is:
for /f "Tokens=*" %%s in ('DCSites [dns host name]') do ( call :DoSomeThing "%%s")
Where [dns host name] is optional and used for querying the site coverage of a remote DC.
DCSites.bat contains:
@echo offsetlocalif {%1}=={} goto lclfor /f "Tokens=*" %%s in ('nltest /Server:%1 /dsgetsitecov^|find /I /V "The command completed successfully"') do ( @echo %%s)endlocalgoto :EOF:lclfor /f "Tokens=*" %%s in ('nltest /dsgetsitecov^|find /I /V "The command completed successfully"') do ( @echo %%s)endlocal
You May Also Like