views:

85

answers:

2

Anyone know how can we moniter file /folder permission on windows. Suppose a user can change the folder permission, the application can log the user, timing and other details.

If neone know third party tool/script for the same, plz suggest.

-Thanks

A: 

Enable filesystem auditing, and set the SACL on a parent folder to audit permission and ownership changes. They will be reported in the System event log.

Richard
+2  A: 

You'll want to use the FileSystemWatcher class, which can raise an event when various properties of directories or files change. In your case, you want to insure you set the NotifyFilter property to include the NotifyFilters.Security flag, which tells is to watch any permissions changes. Some good example code is given on the MSDN page, though FileSystemWatcher is really quite straightforward to use.

Noldorin
By this library i can know my file permission has changed. But how can i know which user changed permission and what was the time?
I'm not sure that's possible in .NET, or even using the WinAPI...
Noldorin