Friday, January 20, 2006

Getting Security Logs From Windows 2003/2000 Servers

Need to get a script together to get security logs from multiple Windows 2000/2003 servers. Want the files compressed locally then xfered to centeral spot.


files:
GetAllLogs.cmd - gets date and time into enviroment variable and launches getsrvlog.cmd.





*********************************************************************************
GetAllLogs.cmd
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i_%%j_%%k_%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=_%%i
set tm=%tm::=_%
set da=%dt%%tm%


echo %tm%
echo %da%



start cmd /c psexec \\server1 -c getsrvlog.cmd %da%
start cmd /c psexec \\server2 -c getsrvlog.cmd %da%
start cmd /c psexec \\server3 -c getsrvog.cmd %da%



*********************************************************************************

No comments: