Search code examples
windowspowershellgpo

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

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


Solution

  • 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