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 off setlocal if \{%1\}==\{\} goto lcl for /f "Tokens=*" %%s in ('nltest /Server:%1 /dsgetsitecov^|find /I /V "The command completed successfully"') do ( @echo %%s ) endlocal goto :EOF :lcl for /f "Tokens=*" %%s in ('nltest /dsgetsitecov^|find /I /V "The command completed successfully"') do ( @echo %%s ) endlocal
0 comments
Hide comments