Editing Local Group Policy via Automation

Posted by bapesta786@reddit | sysadmin | View on Reddit | 12 comments

I am building a gold image for VDI deployment, and part of our gold image setup involves setting a local group policy setting:

Local Computer Policy > Computer Configuration > Windows Settings > Scripts > Startup

Inside there, we specify a script and the parameter.

On a reference machine, I have created this setting, and used LGPO tool to export the local policy. As a test, I deleted the aforementioned setting and ran the LGPO tool again to import the previously exported settings, however the setting doesn't re-appear in local policy editor.

Am I doing something wrong? Can anyone suggest how I control this via automation?