以编程方式编辑secpol.msc?

时间:2013-04-15 15:09:58

标签: c# windows-server-2008 local-security-policy

有没有办法以编程方式从secpol.msc编辑设置?

我正在寻找类似的东西:

        ManagementScope scope = new ManagementScope("root\\rsop\\user\\" + user.User.Value.Replace('-', '_'));
        ObjectQuery query = new ObjectQuery("Select * from RSOP_PolicySetting");
        ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);

root \ secpol \ ...是一个选项吗?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。从secedit导出中读取是完美的:https://gist.github.com/jkingry/421802