Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I need to get the username of the user who deleted a file in folder.
I tried the file system watcher but it does not provide the username.
Can anyone help?
Posted
Comments
Sergey Alexandrovich Kryukov 11-Feb-14 22:45pm    
Why? why?!
—SA

The filesystem does not track who deletes a file.

The only thing you can use to determine this requires that you have Auditing turned on on the server. You can then scan the Security log (Admin permissions required!) to find the Delete entry and the account that did it. Warning! Turning on auditing on too much stuff will generate LOTS and LOTS of entries in the Security log, possibly making it take an inconveniently long time to find the log entry.
 
Share this answer
 
Hardly. File systems, per se, in certain sense, are totally agnostic to the user accounts.

You may argue say that they preserve the permission records indicating what user is authorized to do what. That's true, but won't generally help you. Or, if you will, it can be your last chance. Suppose that only one user had access to some file, so only that user can be blamed for deleting it. However, such cases are rare. It could also be another user, say, with administrative privileges, who could use elevated privilege execution to delete the same file. And many files have access rights shared by more then one user, say, by the whole group. Then — and that would be majority of cases — you have no chance to detect who did it.

And why? Isn't it better to prevent accidents by consistent administration, backup and educating users. What would be your purpose? Just to blame someone? Would be too late.

—SA
 
Share this answer
 
Have a look at this

how-can-i-get-user-who-deleted-file[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Feb-14 22:47pm    
It does not solve the problem posed by OP, who already tried the FileSystemWatcher. The real approach would be: not solving this problem at all, it would be pretty much pointless.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900