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.

91 lines
3.2 KiB

  1. @echo off
  2. SETLOCAL ENABLEEXTENSIONS
  3. if "%1" == "" (
  4. echo Usage: frscheck result_dir [target_computername]
  5. echo result_dir is created if it does not exist.
  6. echo Target_ComputerName is optional. Default is current computer.
  7. echo It can be a netbios name with no leading slashes or a full dns name, xxx.yyy.zzz.com
  8. echo This script uses NTFRSUTL.EXE to gather data from FRS on the
  9. echo Target computer. This tool must be in your path and can be found
  10. echo in the resource kit.
  11. echo ----
  12. goto :QUIT
  13. )
  14. @echo Please WAIT....
  15. set QA=%1
  16. if NOT EXIST %QA% (md %QA%)
  17. for %%x in (ds errscan inlog outlog machine reg sets version config) do (
  18. del %QA%\ntfrs_%%x.txt 1>nul: 2>nul:
  19. )
  20. echo DateTime : %DATE%, %TIME% > %QA%\ntfrs_machine.txt
  21. echo TargetComputer : %2 >> %QA%\ntfrs_machine.txt
  22. echo LocalComputername: %COMPUTERNAME% >> %QA%\ntfrs_machine.txt
  23. echo Architecture : %PROCESSOR_ARCHITECTURE% >> %QA%\ntfrs_machine.txt
  24. echo NumberProcessors : %NUMBER_OF_PROCESSORS% >> %QA%\ntfrs_machine.txt
  25. echo SystemRoot : %SystemRoot% >> %QA%\ntfrs_machine.txt
  26. echo LogonServer : %LOGONSERVER% >> %QA%\ntfrs_machine.txt
  27. echo UserDomain : %USERDOMAIN% >> %QA%\ntfrs_machine.txt
  28. echo UserName : %USERNAME% >> %QA%\ntfrs_machine.txt
  29. REM see if we have ntfrsutl.exe
  30. ntfrsutl > nul: 2> nul:
  31. if ERRORLEVEL 1 (
  32. echo ****** NTFRSUTL.EXE is not in your path. This tool can be found in the resource kit.
  33. echo ****** This tool is needed to gather all the data.
  34. goto :GETREG
  35. )
  36. echo NTFRSUTL checks are running ...
  37. ntfrsutl version %2 > %QA%\ntfrs_version.txt
  38. findstr ERROR %QA%\ntfrs_version.txt
  39. if NOT ERRORLEVEL 1 (
  40. echo ****** NTFRSUTL cannot access target computer "%2".
  41. echo ****** You must be an admin or run FRSCHECK on the target computer to gather all the data.
  42. goto :GETREG
  43. )
  44. ntfrsutl ds %2 > %QA%\ntfrs_ds.txt
  45. ntfrsutl sets %2 > %QA%\ntfrs_sets.txt
  46. ntfrsutl configtable %2 > %QA%\ntfrs_config.txt
  47. echo Dumping FRS inbound and outbound logs ...
  48. ntfrsutl inlog %2 > %QA%\ntfrs_inlog.txt
  49. ntfrsutl outlog %2 > %QA%\ntfrs_outlog.txt
  50. :GETREG
  51. echo Dumping FRS registry parameters ...
  52. regdmp HKEY_LOCAL_MACHINE\system\currentcontrolset\services\NtFrs\Parameters > %QA%\ntfrs_reg.txt
  53. echo Scanning FRS event logs for error/warning info ...
  54. set XCOMP=%windir%\debug
  55. if NOT "%2" == "" (
  56. set XCOMP=\\%2\debug
  57. if NOT EXIST !XCOMP! (
  58. REM debug share didn't work. try admin share.
  59. set XCOMP=\\%2\admin$\debug
  60. )
  61. )
  62. dir !XCOMP!\ntfrs_*.log > %QA%\ntfrs_errscan.txt
  63. if ERRORLEVEL 1 (
  64. echo ****** FRSCHECK cannot access the FRS log files on target computer "%2".
  65. echo ****** You must be an admin or run FRSCHECK on the target computer to gather all the data.
  66. del %QA%\ntfrs_errscan.txt
  67. goto :DONE
  68. )
  69. findstr /i ":SO: :H: error invalid fail abort warn" !XCOMP!\ntfrs_*.log | findstr /v "IO_PEND ERROR_SUCCESS PrintThreadIds FrsErrorSuccess" >> %QA%\ntfrs_errscan.txt
  70. :DONE
  71. echo Done ...
  72. :QUIT