0

I would like to disable automatic updates in group policy using PowerShell (this needs to run on several machines so it needs to be automated). Specifically, I want to set Administrative Templates -> Windows Components -> Windows Update -> Configure Automatic Updates to disabled rather than 'not configured'. It seems like this may be possible with LGPO.exe but I'd prefer to do everything in native Powershell without any separate applications if possible. Ideally, after the script runs, the group policy GUI should show the option as disabled as well (rather than not configured). Essentially, I'm wanting the exact same effect as if I had gone through the GUI to change it.

Any ideas on how to do this?

joejoejoejoe4
  • 1,438
  • 9
  • 25
  • 48
  • [Configuring Group Policies using Windows PowerShell – SID-500.COM](https://sid-500.com/2017/08/25/configuring-group-policies-by-using-windows-powershell/) – DavidPostill Jul 31 '22 at 17:39
  • [windows - How to edit Local Group Policy with a script? - Server Fault](https://serverfault.com/questions/848388/how-to-edit-local-group-policy-with-a-script) – DavidPostill Jul 31 '22 at 17:40
  • @DavidPostill, `Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate -Name "Configure Automatic Updates" -Value 0` gives me an error stating that the HKLM path does not exist. What is the correct one to use? None of the paths in the reference file work. – joejoejoejoe4 Jul 31 '22 at 18:00
  • @jippyjoe4 Give [`New-ItemProperty`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-itemproperty?view=powershell-7.2) a shot since that does not already exist. The "set" command will set existing, the "new" command should create if it does not exist. – Vomit IT - Chunky Mess Style Aug 01 '22 at 12:30
  • @jippyjoe4 did you find a solution? – yakhtarali Feb 13 '23 at 10:00
  • @yakhtarali, no, I haven't got around to trying again yet – joejoejoejoe4 Feb 13 '23 at 18:58

0 Answers0