P.S. I was not strictly correct saying "the problem does manifest itself even when I'm accessing the file in the same folder, on the same server, but using another method (UNC path):" - yes, it does, but not in the same way as when the share is accessed from a user workstation (not from the server itself): I've found out that
- deleting a file located in a file share while you are logged on to that server produces neither 4660 event nor 4663 event with access mask =65536 (DELETE) - there will be no traces that a file has been deleted
- deleting a file located in a file share from some other computer does not produce any 4660 events but does produce the event 4663 with Access Mask = 65536, for example:
- I deleted the file (New Bitmap Image.bmp) in the same share - \fs\Test - from another server :
(you can make sure this was the "network" deletion by looking at the ProcessName field - it must be empty in that case)
- it means the number of 4660 events will not be equal to the number of 4663 events with Access mask=65536!
- The number of events 4663 with AM=65536 (and - in theory - events 4660) may double on some servers:
I've never seen the problems described in 1 and 2 and am sure I can't count on such audit in production environment.
Now I see these problems (1-2) in Windows Server 2012R2, Windows Server 2019 and Windows Server 2022.
On Windows Server 2012R2 I've been able to see the two correct events 4660 when the files in the share were deleted from a client workstation - all other attempts (~10) were unsuccessfull (there were no 4660 events but all 4663 events with access mask 65536 were created).
You can find the scripts that were used to produce the txt-files mentioned in this post here:
Windows Audit Part 4: Tracing file deletions in MS PowerShell
Regards,
Michael