[英]How to Edit Local Group Policy using PowerShell
In Local Group Policy Editor (GUI) there is a setting called Do not allow window animations
located in Computer Configuration
-> Administrative Templates
-> Windows Components
-> Desktop Window Manager
that I would like to set as Enabled using the powershell, Since my windows version is professional I can added the RSAT GroupPolicy capability to my machine which I did and now I can use the Group Policy Cmdlets in Windows PowerShell在本地组策略编辑器 (GUI) 中,有一个名为
Do not allow window animations
的设置位于Computer Configuration
-> Administrative Templates
-> Windows Components
-> Desktop Window Manager
,我想使用 powershell 将其设置为已启用,因为我的 windows版本是专业版 我可以将 RSAT GroupPolicy 功能添加到我的机器,现在我可以在 Windows PowerShell 中使用组策略 Cmdlet
but I am clue less on how to Enable that feature using the commands但我不太了解如何使用命令启用该功能
I tired to use我厌倦了使用
Get-GPO -Name "Do not allow window animations"
but this returns但这返回
Get-GPO : Current security context is not associated with an Active Directory domain or forest.
the grouppolicy module is wokring fine but I can't figure out how to query or change the value of any settings in the GPO grouppolicy 模块工作正常,但我不知道如何查询或更改 GPO 中任何设置的值
The Get-GPO function is meant exclusively for Domain Group Policies, and not Local Policies, which it seems you are referencing. Get-GPO function 专用于域组策略,而不是您正在引用的本地策略。 The description for the module also mentions this:
该模块的描述还提到了这一点:
Gets one GPO or all the GPOs in a domain.
获取域中的一个 GPO 或所有 GPO。
In order to modify local policies, you need to make a change to the respective setting in the registry为了修改本地策略,您需要更改注册表中的相应设置
For example to disable the Shutdown button, you would need to modify:例如要禁用关机按钮,您需要修改:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Start\HideShutDown
Value = 1
If you want cmdlets in order to change values you can use the PolicyFileEditor module from the gallery https://www.powershellgallery.com/packages/PolicyFileEditor/3.0.1如果您想要 cmdlet 以更改值,您可以使用库中的 PolicyFileEditor 模块https://www.powershellgallery.com/packages/PolicyFileEditor/3.0.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.