scripted file auditing without updating file attributes
Posted on 2006-05-08
I’ve been trying to write a file audit script that will obtain some basic attributes of all files on a CIFS based file system, but not modify the last accessed date.
I am extracting the filename, size, last modified date, last access date and most importantly the owner of the file. The first attributes can be obtained without issue, but as soon as I try to extract the file owner, the last access date gets modified.
I have considered making the script overwrite the access date after reading the ownership, but feel that adding a write cycle to the script will add a significant delay to the process.
You can read these attributes manually with explorer with out touching the file, so it seems it should be possible to perform the task via the command line as well.
I’ve written ( and re-written) the script in perl, vb script and have just tried my hand with powershell (aka monad), but the same result seems to occur across all the methods.