首页 文章

对Windows本地安全策略的编程操作

提问于
浏览
-2

我正在寻找一种方法来以编程方式访问和修改PC中的本地组策略设置 .

例如,如果我想检查/修改设置的值

“计算机配置\ Windows设置\安全设置\本地策略\审核策略\审核登录事件”(从gpedit获取的路径),我应该能够通过命令行查询它或设置一个值,而无需gpedit或任何其他本机GUI界面 .

Possible methods that I could think that might solve this problem were either of the following two:-

1. 本地组策略设置操作的编程接口

Based on my search 

i. There were no official documentation or tools from Microsoft that could query and manipulate a given setting in Local Security Policy. 

ii. The closest I could get was a vendor named sdmsoftware (Link:- https://sdmsoftware.com/group-policy-management-products/group-policy-automation-engine/) who provides a powershell interface for manipulating the Local group policy. Since the company I work is just a startup, we cant invest on any tools right now. Hence buying something is out of scope.I am looking for a freeware / OSS / any work-around to achive this.

2. 映射文件,包含映射到相应注册表项或文件路径的所有本地安全设置 . 这样可以使用相同的注册表项或文件来直接查询或修改安全设置 .

Based on my search 

i. I found a list given by Microsoft which gives a corresponding  registry key to some of the Local Security Policy settings. However , the list does not contain mappings of all Local Security Settings.
(Link:- www . microsoft . com /en - us / download / details . aspx ? id=25250)

我知道查询任务可以通过使用gpresult导出结果并解析它来完成,但是同样的修改是不可能的 . 我还尝试测试和分析以下Microsoft工具,以某种方式获取各种本地组策略设置的路径,通过在PSmon等工具下监视,以查看正在打开的文件以及正在查询的注册表等.-
a) Security Compliance Manager(链接:-technet .microsoft.com / en-us / solutionaccelerators / cc835245.aspx)

b) Microsoft Security Compliance Toolkit(链接:-www.microsoft.com / en-us / download / confirmation.aspx?id = 55319&6B49FDFB-8E5B-4B07-BC31-15695C5A2143 = 1)

然而,它没有产生任何结果也可能因为我可能没有正确分析它们 .

我想知道是否有任何文件/文章/免费(免费啤酒免费)编程界面的本地安全策略/任何围绕黑客的工作,可以允许我以编程方式编辑和查询本地组设置 .

提前致谢 .

1 回答

  • 0

    不幸的是,安全设置中的每个设置都不能以相同的方式访问 .

    如您所说,您可以在注册表中设置大多数设置 . 如果不是,则高度取决于您要修改的设置 . 例如,您可以使用:

    Afaik没有针对所有设置的解决方案 . 如果您需要修改其他设置,您应该要求这个特定的设置,以找到一个程序化的方法解决方案 .

相关问题