Zero-XAtlasHelp

Script library ›

Repair-WindowsUpdateService

Start the Windows Update service. Shows the Windows Update service state and starts it. With -FixStartType, changes Disabled to Manual.

needs adminsupports -WhatIfrisk: lowversion 1written by an assistant from cited pages
untested here · 0 fixed, 0 not

What it does

Use this for error 0x80070422, which means the Windows Update service is stopped or cannot start.

The script shows the service status and start type, then starts the service. A service set to Disabled cannot start. With -FixStartType the script changes Disabled to Manual, which is the Windows default for this service. If something keeps disabling the service, look at Group Policy and your management tools instead of running this again.

Parameters

Examples

.\Repair-WindowsUpdateService.ps1

Reports the service and starts it if it is stopped.

.\Repair-WindowsUpdateService.ps1 -FixStartType -WhatIf

Shows what would change and changes nothing.

Microsoft's guidance

The script

Click the script to select all of it, then copy. Fingerprint of this text (SHA-256): 26783ce600ed1943bed656959896c85e6251d24bb59e2dce499983f2df4c220d. Updated 2026-10-21.

# Copyright (c) 2026 Owen Perry. All rights reserved.
#Requires -Version 5.1
#Requires -RunAsAdministrator

<#
.SYNOPSIS
Checks the Windows Update service and starts it if it is not running.

.DESCRIPTION
Use this for error 0x80070422, which means the Windows Update service is stopped or cannot start.

The script shows the service status and start type, then starts the service. A service set to Disabled cannot start.
With -FixStartType the script changes Disabled to Manual, which is the Windows default for this service.
If something keeps disabling the service, look at Group Policy and your management tools instead of running this again.

.PARAMETER FixStartType
Changes a Disabled start type to Manual.

.EXAMPLE
.\Repair-WindowsUpdateService.ps1
Reports the service and starts it if it is stopped.

.EXAMPLE
.\Repair-WindowsUpdateService.ps1 -FixStartType -WhatIf
Shows what would change and changes nothing.

.LINK
https://learn.microsoft.com/en-us/troubleshoot/windows-client/installing-updates-features-roles/common-windows-update-errors
#>

[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param([switch]$FixStartType)

$ErrorActionPreference = 'Stop'

# wuauserv is the Windows Update service.
$service = Get-Service -Name wuauserv
"Windows Update service: status $($service.Status), start type $($service.StartType)"

# A Disabled service cannot be started, so deal with that first.
if ($service.StartType -eq 'Disabled') {
    if (-not $FixStartType) {
        Write-Warning 'The service is Disabled, so it cannot start. Run again with -FixStartType, or find out what disabled it.'
        exit 2
    }
    if ($PSCmdlet.ShouldProcess('wuauserv', 'Set the start type to Manual')) {
        Set-Service -Name wuauserv -StartupType Manual
        Write-Host 'Start type set to Manual.'
    }
}

if ((Get-Service -Name wuauserv).Status -eq 'Running') {
    Write-Host 'The service is already running.'
} elseif ($PSCmdlet.ShouldProcess('wuauserv', 'Start service')) {
    Start-Service -Name wuauserv
    (Get-Service -Name wuauserv).WaitForStatus('Running', '00:01:00')
    Write-Host 'The service is running. Try the update again.'
}
Tested this in a lab? Record the result
(Enterprise subscription only)