[英]Moniter folder permission
Anyone know how can we moniter file /folder permission on windows. 任何人都知道我们如何在Windows上监视文件/ folder权限。 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. 如果没有人知道相同的第三方工具/脚本,请PLZ建议。
-Thanks -谢谢
You'll want to use the FileSystemWatcher
class, which can raise an event when various properties of directories or files change. 您将要使用
FileSystemWatcher
类,该类可在目录或文件的各种属性更改时引发事件。 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. 对于您的情况,您要确保将
NotifyFilter
属性设置为包括NotifyFilters.Security
标志,该标志NotifyFilters.Security
监视所有权限更改。 Some good example code is given on the MSDN page, though FileSystemWatcher
is really quite straightforward to use. MSDN页面上给出了一些很好的示例代码,尽管
FileSystemWatcher
确实非常易于使用。
Enable filesystem auditing, and set the SACL on a parent folder to audit permission and ownership changes. 启用文件系统审核,并在父文件夹上设置SACL以审核权限和所有权更改。 They will be reported in the System event log.
它们将在系统事件日志中报告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.