- Get the list of domain controllers in forest. To do this, run the following command:
- Dsquery server -r rdn -forest > C:\DCList.txt
- The DC List will be stored in the DCList.TXT file. You need to use this file with the FOR command as shown below:
- FOR /F “Tokens=*” %L IN (C:\DCList.txt) DO DIR /s \\%L\SYSVOL | Find /i “_NTFRS” >> C:\Result.TXT
The above FOR command runs against each DC in DCList.txt and looks for _NTFRS folder in SYSVOL share. If it finds it returns the name of the folder. The end results will be stored in the C:\Result.txt.