How to edit Local Group Policy by powershell?

Hey guys, I need help.
I need to edit local group policies remotely.
I have a tool that allows me to run scripts through power shell and cmd. So I thought of using this tool, but now comes the question, is there a possibility to edit policies by powershell or cmd? :thinking:
Does anyone have the key to this riddle? :fearful:

There are a number of ways to get this done. For the most part, you can translate the settings to their resulting registry setting and manipulate them in that fashion using Set-ItemProperty. Google is your friend here.

If you have a lot of items to change, you can create your own Security Database via the Security Configuration and Analysis MMC, then use Secedit.exe to apply it.

You might also have a look at this Module:


Keep in mind though that PolicyFileEditor works for Admin templates only, there is a lot of space for improvement of this module.

If you need it for serious work you’ll want to improve the module, which if you decide start by learning the pol file format:

1 Like