Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.1 KiB

  1. @echo off
  2. REM \logs\chkdc [AFRICA | NORTH |NTDEV | REDMOND]
  3. REM
  4. REM Check version of policy template file.
  5. REM
  6. REM "\\<dcname>\
  7. REM sysvol\
  8. REM northamerica.corp.microsoft.com\
  9. REM Policies\
  10. REM {6AC1786C-016F-11D2-945F-00C04fB984F9}\
  11. REM Machine\
  12. REM Microsoft\
  13. REM Windows NT\
  14. REM SecEdit\
  15. REM GPTTMPL.INF"
  16. goto :%1
  17. :REDMOND
  18. set dom_name=redmond.corp.microsoft.com
  19. goto :CHECK_POLICY
  20. :NTDEV
  21. set dom_name=ntdev.microsoft.com
  22. goto :CHECK_POLICY
  23. :AFRICA
  24. set dom_name=africa.corp.microsoft.com
  25. goto :CHECK_POLICY
  26. :NORTH
  27. set dom_name=northamerica.corp.microsoft.com
  28. goto :CHECK_POLICY
  29. :FAREAST
  30. set dom_name=fareast.corp.microsoft.com
  31. goto :CHECK_POLICY
  32. :CHECK_POLICY
  33. set filename=sysvol\%dom_name%\Policies\{6AC1786C-016F-11D2-945F-00C04fB984F9}\Machine\Microsoft\Windows NT\SecEdit\GPTTMPL.INF
  34. REM get list of DCs in a domain with:
  35. REM
  36. REM >nltest /dclist:africa
  37. REM Get list of DCs in domain 'africa' from '\\AFRICA-DC-03'.
  38. REM AFRICA-DC-04.africa.corp.microsoft.com [DS] Site: NA-WA-EXCH
  39. REM AFRICA-DC-03.africa.corp.microsoft.com [PDC] [DS] Site: NA-WA-RED
  40. REM JOB-DC-01.africa.corp.microsoft.com [DS] Site: AF-ZA-JOB
  41. REM
  42. nltest /dclist:%dom_name% > dclist.tmp
  43. type dclist.tmp
  44. FOR /F "eol=; tokens=1 delims=, " %%i in (dclist.tmp) do (
  45. if /i not "%%i"=="get" (
  46. if /i not "%%i"=="the" (
  47. @echo %%i
  48. dir "\\%%i\%filename%"
  49. sc \\%%i query ntfrs
  50. )
  51. )
  52. )
  53. goto :QUIT
  54. REM Get FRS logs
  55. for %%x in (%dclist%) do (
  56. rem md %%x
  57. ls -l "\\%%x\%filename%"
  58. rem copy \\%%x\c$\winnt\debug\ntfrs* %%x\
  59. )
  60. goto :QUIT
  61. REM create a test file under a test dir in the scripts dir of each DC.
  62. for %%x in (%dclist%) do (echo "07:05PM" > \\%%x\sysvol\africa.corp.microsoft.com\scripts\frs-1test\From_%%x)
  63. for %%x in (%dclist%) do dir \\%%x\sysvol\africa.corp.microsoft.com\scripts\frs-1test
  64. :QUIT