简体   繁体   English

阅读本地安全策略

[英]Reading local security policy

I am trying to read a value from the Local security policies using C#. 我正在尝试使用C#从本地安全策略中读取一个值。 The value I am trying to read is the Debug Programs under the User Rights Assignment folder. 我尝试读取的值是“用户权限分配”文件夹下的“调试程序”。

As far as I can tell, these settings don't get stored in registry. 据我所知,这些设置不会存储在注册表中。 You might have some success using the secedit command line tool. 使用secedit命令行工具可能会取得一些成功。 cmd /c secedit /export /cfg myfile.inf /areas USER_RIGHTS will generate the inf file which you can then parse to fish out the information you need. cmd /c secedit /export /cfg myfile.inf /areas USER_RIGHTS将生成inf文件,您可以对其进行解析以获取所需的信息。 Not a very elegant solution, unfortunately, perhaps someone else can offer a better one. 不幸的是,这不是一个非常优雅的解决方案,也许有人可以提供更好的解决方案。

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

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