Modify GPOs using a PowerShell script
LeBoudougourt -
Hello, I've been struggling with this for a while.
Basically, I have a local policy that I want to change from "enabled" to "disabled", but I want to do it without going through the policy editor.
I've tried modifying the registry, but it doesn't update the policy in question, and when I restart the PC, the registry reverts to the default value. So I don't know what to do next; if you have any tips, I'm all ears :)
2 answers
Hello,
which GPO are you referring to exactly?
What argument did you use in the script? Here’s an interesting link with all the arguments, though I'm not sure if they will all work locally: https://learn.microsoft.com/en-us/powershell/module/grouppolicy/?view=windowsserver2022-ps&viewFallbackFrom=win10-ps
It's a silly question but are you sure you're in a session with sufficient rights? Best regards
Hello,
The GPO is located in administrative templates > windows components > internet explorer > prevent changing proxy settings, in the user configuration tab, something like that if I’m not mistaken.
For the script, I’m using PowerShell so I just identified the path of the registry in question. For this registry, when the local policy is set to "enabled," a registry key named "Proxy" appears with a value of 1, and when the policy is "disabled," this key disappears.
So with my script, I specified the path of the registry, I provided the name (so Proxy) and I deleted it, which worked.
But the policy doesn’t update after that.
And yes, the user I’m using is a full admin, so there shouldn’t be any issues with permissions.
(And I’ll take a look at the link but it seems I’ve seen it before)
Thanks in advance :)