Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off windows update service & auto updates windows 10 using powershell

I want to use a powershell script to turn off windows update service & auto updates windows 10 using powershell. I've searched around but the commands didn't turn either one off completely.

I'm manually doing this now on devices that aren't on the network, so no group policy will be able to be deployed:

services> windows update> disable Windows Update > Change Settings > Never Check for Updates

like image 392
Jenesis Avatar asked Jun 14 '17 21:06

Jenesis


People also ask

Can I disable Windows Update service?

Scroll down the page, click to select the Disable Microsoft Update software and let me use Windows Update only check box, and then click Apply changes now. You receive the following message: Windows Automatic Updates will not be able to deliver updates from Microsoft Update Service.

What happens if I disable Windows Update service?

Disabling automatic updates on Professional, Education and Enterprise editions of Windows 10. This procedure stops all updates until you decide they no longer present a threat to your system. You can manually install patches while automatic updates are disabled. Press the Windows key and “R”.

Can you permanently disable Windows 10 update?

Using the Win + R keyboard shortcut, type services. msc to access your PC's service settings. Next, scroll down and double-click on Windows Update to access the General settings. Now, select Disabled from the Startup type dropdown menu.


1 Answers

I found this information you can try it

Powershell

 Clear-Host

Write-Host "0 -> Change setting in Windows Update app (default)"
Write-Host "1 -> Never check for updates (not recommended)"
Write-Host "2 -> Notify for download and notify for install"
Write-Host "3 -> Auto download and notify for install"
Write-Host "4 -> Auto download and schedule the install"

Write-Host "Enter any character to exit"
Write-Host
switch(Read-Host "Choose Window Update Settings"){
       0 {$UpdateValue = 0}
       1 {$UpdateValue = 1}
       2 {$UpdateValue = 2}
       3 {$UpdateValue = 3}
       4 {$UpdateValue = 4}
       Default{Exit}
}

$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
}


If ($UpdateValue -gt 0) {
    New-Item -Path $WindowsUpdatePath
    New-Item -Path $AutoUpdatePath
}

If ($UpdateValue -eq 1) {
    Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1
}

If ($UpdateValue -eq 2) {
    Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name AUOptions -Value 2
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallDay -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallTime -Value 3
}

If ($UpdateValue -eq 3) {
    Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name AUOptions -Value 3
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallDay -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallTime -Value 3
}

If ($UpdateValue -eq 4) {
    Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name AUOptions -Value 4
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallDay -Value 0
    Set-ItemProperty -Path $AutoUpdatePath -Name ScheduledInstallTime -Value 3
}
like image 180
Kemal K. Avatar answered Oct 08 '22 19:10

Kemal K.