Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows本地安全策略的程序化操作_Windows_Powershell_Sysadmin_Local Security Policy - Fatal编程技术网

Windows本地安全策略的程序化操作

Windows本地安全策略的程序化操作,windows,powershell,sysadmin,local-security-policy,Windows,Powershell,Sysadmin,Local Security Policy,我正在寻找一种方法来访问和修改本地组策略设置在电脑编程 例如,如果要检查/修改设置的值 “计算机配置\Windows设置\Security Settings\Local Policys\Audit Policy\Audit Logon Events”(路径取自gpedit),我应该能够在没有gpedit或任何其他本机GUI界面的情况下通过命令行对其进行查询或设置值 我认为可能解决此问题的方法有以下两种:- 1.用于本地组策略设置操作的编程接口 Based on my search i. Th

我正在寻找一种方法来访问和修改本地组策略设置在电脑编程

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

“计算机配置\Windows设置\Security Settings\Local Policys\Audit Policy\Audit Logon Events”(路径取自gpedit),我应该能够在没有gpedit或任何其他本机GUI界面的情况下通过命令行对其进行查询或设置值

我认为可能解决此问题的方法有以下两种:-

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)安全合规经理 (链接:-technet.microsoft.com/en us/solutionaccelerators/cc835245.aspx)

b)Microsoft安全合规工具包 (链接:-www.microsoft.com/en-us/download/confirmation.aspx?id=55319&6B49FDFB-8E5B-4B07-BC31-15695C5A2143=1)

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

我想知道是否有任何文档/文章/本地安全策略的免费(就像免费啤酒一样免费)编程接口/允许我以编程方式编辑和查询本地组设置的任何变通方法


提前感谢。

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

正如您已经说过的,您可以在注册表中设置大多数设置。如果不是,则在很大程度上取决于要修改的设置。例如,您可以使用:

  • 用于审核策略设置
  • 用于用户权限分配

Afaik没有针对所有设置的解决方案。如果您需要修改其他设置,则应询问此特定设置,找到一个程序化的解决方案。

为什么不使用GP来编辑GPO?@我猜GP的意思是说gpedit是不可纠正的。我必须根据我的想法定期为给定的一组配置和修复准备一份报告。我们有大约100个系统。使用gui和修改每个系统中的设置是不可能的。因此采用了这种方法。不,我指的是集团政策。使用组策略服务器mmc。系统处于工作组模式,我们还没有域控制器。如果真是这样的话,这个问题就很容易解决了。虽然它看起来很愚蠢,但它的管理层决定,我也无能为力。我可能错了,但我知道GP服务器mmc只适用于域,而不适用于工作组。因此,我认为这将是一条前进的道路。现在也编辑了标题,因为它有点误导。谢谢。。我会试试的。。谢谢:)