There definitely might be a better way to do this, but here is what I was able to figure out simply...
Configuration for local group policy is stored in the following location:
C:\Windows\System32\GroupPolicy
If you go to that directory and open the gpt.ini file, you should see a line with "Options=" and then a value indicating the settings you are wanting to change.
0: Neither box is checked
1: Only Disable User Configuration is checked
2: Only Disable Computer Configuration is checked
3: Both are checked
I think by default both boxes are unchecked, and that line is not present. If modified, that .ini file should contain the options key with a value set. Here is a pretty simple script that would ensure both boxes are unchecked.
$gptIniFilePath = 'C:\Windows\System32\GroupPolicy\gpt.ini'
$encoding = 'UTF8'
$gptIniContent = Get-Content -Encoding $encoding -Path $gptIniFilePath
foreach ($s in $gptIniContent) {
if($s.StartsWith("Options=")) {
$num = ($s -split "=")[1]
$val = [Convert]::ToInt32($num)
$newVal = 0
(Get-Content $gptIniFilePath) | ForEach-Object {$_ -replace "Options=$val","Options=$newVal" } |
Set-Content -Encoding $encoding $gptIniFilePath -Force
}
}
If you wanted to set them to anything other than unchecked, you would have to write a script that checks for the existence of that key in the .ini and add it if it isn't present.