Posted On June 9, 2021

Disable Windows 10 Automatic Updates

kimconnect 0 comments
blog.KimConnect.com >> Windows >> Disable Windows 10 Automatic Updates

Why?

It’s annoying if Windows keep updating automatically in the background and even reboot when idle.

Risk?

Yes, If auto updates are disabled, one should take care to manually update Windows on a regular basis.

How?

Run PowerShell (as Administrator):

function disableWindowsAutoUpdate{
    param(
    $windowsRegHive='REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows',
    $hiveName='WindowsUpdate',
    $keyName='AU',
    $disable='0'
    )
    try{
        # set the Windows Update service to "disabled"
        stop-service wuauserv -force
        set-service wuauserv -startup disabled
        $currentAUSettings=(get-itemproperty 'REGISTRY::HKLM\SYSTEM\CurrentControlSet\Services\wuauserv').Start
        if($currentAUSettings -eq 4){
            write-host "Windows Automatic Updates have been disabled."
        }        
        $autoUpdateSettings = (New-Object -com 'Microsoft.Update.AutoUpdate').Settings
        $autoUpdateSettings.NotificationLevel=1
        $autoUpdateSettings.Save
        write-host "Option to 'never check for update (not recommended)' has been set"
        
        # Set Windows AU registry key
        if(!(get-item "$windowsRegHive\$hiveName")){
            New-Item -Path $windowsRegHive -Name $hiveName -Force
        }        
        $null=New-ItemProperty -Path "$windowsRegHive\$hiveName" -Name $keyName -Value $disable -PropertyType DWORD -Force
        write-host "Registry key $keyName has been set to value $disable"
        return $true
    }catch{
        write-warning $_
        return $false
    }
}
# Legacy commands
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\WaasMedicSvc /v Start /f /t REG_DWORD /d 4
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v Start /f /t REG_DWORD /d 4
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc /v Start /f /t REG_DWORD /d 4

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Kill a Windows Service Forcefully

# killService.ps1 $serviceName='vmms' function killService($serviceName='Spooler',$restart=$false){ $processId=Get-WmiObject -Class Win32_Service -Filter "Name LIKE '$serviceName'"|Select-Object -ExpandProperty ProcessId if($processId.count…

View FSMO Roles

View FSMO RolesC:\WINDOWS>ntdsutil > ntdsutil.exe Type roles, and then press ENTER.ntdsutil: roles fsmo maintenance:Note: To…

PowerShell: Remove an A-Host Record within Active Directory Integrated DNS Domain

Warning: this code is NOT 'production ready'. Please review and test on DEV environments carefully…