Pages

Friday, December 2, 2011

Track Changes in Windows Server 2003 and higher

If you are a Windows Server administrator, one of the critical jobs you usually do is manage the server, especially File Servers.

File Servers are usually accessible to more than one user for retrieving, adding, modifying, or deleting files. And, the reality is, it's hard to keep track of what changes other users have made over a period of time. The only way to keep track of the changes is to document the baseline and the differences at every step. Sort of like a daily inventory and audit of your directories.

To do this, you need to create a batch file using a text editor. It will record the date & time when the record was taken and the actual details which you can use to compare the changes. Directory structures or files present in the directories will be saved in Filesys.log

1. In your text editor, preferably Notepad, type in the following :

echo OFF
echo Filesystem Snapshot in Progress
echo OFF
echo Snapshot Time: %date% %time% >> "Filesys.log"
echo >> "Filesys.log"
echo ==== START OF LOG ================== >> "Filesys.log"
tree /F >> "Filesys.log"
echo ==== END OF LOG ==================== >> "Filesys.log"

2. Save it as .bat in C:\ .

3. Once saved, on the command line, just type in the name of the batch file to execute.

Example: C:\> FSAUDIT.bat

This should execute and produce a file Filesys.log on the same directory.

4. Rename Filesys.log into a filename indicating the date when the snapshot was taken.

Example: C:\> ren Filesys.log_Mar_24_2010.log

5. To compare changes between various log files, execute "fc" command.

Example: C:\> fc Mar_10_2010.log_Mar_24_2010.log
Comparing files Mar_10_2010.log and Mar_24_2010.log
***** Mar_10_2010.log
C:.
„ angel.txt
„ BA_activities.doc

***** Mar_24_2010.log
C:.
„ jhjhjhangel.txt
„ BA_activities.doc
*****


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.