Disable Windows Server Update via Powershell/CLI

Create a file with notepad and paste below code, rename file as disable_update.ps1 then open Powershell as Admin then run it ./ps1 $WUSettings = (New-Object -com “Microsoft.Update.AutoUpdate”).Settings $WUSettings.NotificationLevel=1 $WUSettings.save() $WindowsUpdatePath = “HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\” $AutoUpdatePath = “HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU” If(Test-Path -Path $WindowsUpdatePath) { Remove-Item -Path $WindowsUpdatePath -Recurse } New-Item -Path $WindowsUpdatePath New-Item -Path $AutoUpdatePath Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1