Repository navigation
Command line options? #94
Replies: 2 comments 6 replies
|
Probably the easiest way to do this is to export your policy settings to REG files and apply them with If you want to import into the real local GPO, you will need to create a POL file and actually use Policy Plus for the import. There isn't an official command line interface (yet?), but since it's .NET you can use its components from PowerShell as a workaround. The sample code in #5 might get you started. |
|
I am using this powershell workflow: Have .reg files being deployed to target machine, e.g. regedit /s %~dp0defenderPolicy.regImport these to Local Group Policies: [System.Reflection.Assembly]::LoadFile("$PSScriptRoot\PolicyPlus.exe") | Out-Null
$main = New-Object PolicyPlus.Main
$compGpoLoader = New-Object PolicyPlus.PolicyLoader ('LocalGpo', '', $false)
$compGpoSrc = $compGpoLoader.OpenSource()
$compRegLoader = New-Object PolicyPlus.PolicyLoader ('LocalRegistry', 'HKLM', $false)
$compRegSrc = $compRegLoader.OpenSource()
$compRegFile = $main.GetOrCreatePolFromPolicySource($compRegSrc)
$compRegFile.Apply($compGpoSrc) | Out-Null
$compGpoLoader.Save() | Out-Null
$compGpoLoader.Close()Update Policy Store (or restart instead) gpupdate |
Uh oh!
There was an error while loading. Please reload this page.
Hi there,
Is there a way I can configure policies on one computer using Policy Plus (which is a brilliant program), then copy them to another computer and apply them via command line?
Thanks,
Thane
All reactions