简体   繁体   English

如何使用.NET更改本地安全策略

[英]How to Change Local Security Policy using .NET

I have read too many topics about reading from Local Security Policy, but I need to change its values, spesifically "Audit system events". 我阅读了太多有关从本地安全策略中读取内容的主题,但是我需要更改其值,尤其是“审核系统事件”。

How to do that using .NET environment.. 如何使用.NET环境做到这一点。

I have solved the problem, by running this command in the command line cmd.exe : 通过在命令行cmd.exe运行以下命令,我已经解决了问题:

Auditpol /set /category:system /success:enable /failure:disable

in order to do that I saved it in a .bat file and run it as administrator. 为了做到这一点,我将其保存在.bat文件中并以管理员身份运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM