Home/Blog/Windows Update Commands | PowerShell UsoClient Guide
Patching

Windows Update Commands | PowerShell UsoClient Guide

Master Windows update management with essential commands for PowerShell, UsoClient, and legacy WUAUCLT tools

Windows Update Commands | PowerShell UsoClient Guide

Effective Windows update management is crucial for maintaining system security, stability, and performance. Whether you’re troubleshooting update failures, automating patch deployment, or managing updates across enterprise environments, understanding the right command-line tools can save time and prevent costly security vulnerabilities.

USOClient: Modern Update Management

The Update Session Orchestrator (USOClient) is the modern replacement for WUAUCLT, introduced in Windows 10 and Server 2016. It provides streamlined update management with better integration into the Windows Update service architecture.

USOClient Command Reference

CommandDescription
startscanInitiate scan for available updates
startdownloadBegin downloading discovered updates
startinstallInstall downloaded updates
refreshsettingsRefresh Windows Update settings
startinteractivescanOpen dialog and start scanning
restartdeviceRestart to complete update installation
scaninstallwaitScan, download, and install in sequence

USOClient Usage Examples

# Scan for available updates
usoclient startscan

# Download detected updates
usoclient startdownload

# Install downloaded updates
usoclient startinstall

# Complete workflow: scan, download, and install
usoclient scaninstallwait

PowerShell: Advanced Update Automation

PowerShell provides the most flexibility and power for Windows update management. The PSWindowsUpdate module enables sophisticated update automation, filtering, and reporting capabilities that surpass both WUAUCLT and USOClient.

Installing PSWindowsUpdate Module

# Install from PowerShell Gallery (PowerShell 5+)
Install-Module PSWindowsUpdate

# Import the module
Import-Module PSWindowsUpdate

# Add Microsoft Update service
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d

Essential PowerShell Update Commands

# List available updates
Get-WUList -MicrosoftUpdate

# Install all updates with automatic reboot
Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot

# Install updates without automatic reboot (recommended)
Get-WUInstall -MicrosoftUpdate -AcceptAll

# Check if reboot is required
Get-WURebootStatus

# View update history
Get-WUHistory

Advanced PowerShell Filtering

# Install only security updates
Get-WUInstall -MicrosoftUpdate -Category "Security Updates" -AcceptAll

# Exclude specific updates by title
Get-WUInstall -MicrosoftUpdate -AcceptAll -NotTitle "Silverlight"

# Install updates for specific products
Get-WUInstall -MicrosoftUpdate -Category "Critical Updates" -AcceptAll

Remote Computer Management

PSWindowsUpdate excels at managing updates across multiple remote computers, making it ideal for enterprise environments and MSP deployments.

# Install updates on remote computer
Get-WUInstall -ComputerName SERVER01 -MicrosoftUpdate -AcceptAll

# Install updates on multiple computers
Get-WUInstall -ComputerName SERVER01,SERVER02,SERVER03 -MicrosoftUpdate -AcceptAll

# Use credentials for remote access
$cred = Get-Credential
Invoke-WUJob -ComputerName SERVER01 -Script {Get-WUInstall -MicrosoftUpdate -AcceptAll} -Credential $cred

# Check update status on remote computers
Get-WUList -ComputerName SERVER01,SERVER02 -MicrosoftUpdate

Specific Update Management

Install, hide, or remove specific updates by KB article number for precise control over your update environment.

# Install specific KB update
Get-WUInstall -KBArticleID KB5034441 -AcceptAll

# Install multiple specific updates
Get-WUInstall -KBArticleID KB5034441,KB5034123 -AcceptAll

# Hide problematic updates
Hide-WindowsUpdate -KBArticleID KB5034441 -Confirm:$false

# Show previously hidden updates
Show-WindowsUpdate -KBArticleID KB5034441

# List all hidden updates
Get-WindowsUpdate -IsHidden

# Remove/uninstall specific update
Remove-WindowsUpdate -KBArticleID KB5034441 -NoRestart

Scheduled Automation

Automate update installation using Windows Task Scheduler for maximum flexibility and control over maintenance windows.

# Schedule update installation for 2 AM
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -ScheduleJob (Get-Date "02:00")

# Schedule with automatic reboot at specific time
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot -ScheduleReboot (Get-Date "03:00")

# Install updates after reboot using RecurseCycle
Get-WUInstall -MicrosoftUpdate -AcceptAll -RecurseCycle 3 -AutoReboot

# Create scheduled task for weekly updates
$action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-Command `"Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot`""
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At 2am
Register-ScheduledTask -TaskName "WeeklyUpdates" -Action $action -Trigger $trigger -RunLevel Highest

Email Reporting and Notifications

Configure email notifications to stay informed about update installation status and results.

# Send email report after update installation
Get-WUInstall -MicrosoftUpdate -AcceptAll -SendReport -PSWUSettings @{
    SmtpServer="smtp.company.com"
    Port=587
    To="[email protected]"
    From="[email protected]"
}

# Configure email settings for future use
$EmailParams = @{
    SmtpServer = "smtp.office365.com"
    Port = 587
    To = "[email protected]"
    From = "[email protected]"
    Subject = "Windows Update Report - {0}" -f $env:COMPUTERNAME
}
Set-PSWUSettings @EmailParams

# Send history report
Get-WUHistory -Last 30 -SendReport

# Email report with specific format
Get-WUInstall -MicrosoftUpdate -AcceptAll -SendHistory -SendReport

WUAUCLT: Legacy Windows Update Management

The Windows Update Automatic Update Client (WUAUCLT) was the primary command-line utility for managing Windows updates on older systems like Windows 7 and Server 2012R2. While deprecated in modern Windows versions, it remains essential for legacy system administration.

⚠️ Important: WUAUCLT has been deprecated in Windows 10 and Server 2016+. Use USOClient or PowerShell for modern systems.

Essential WUAUCLT Commands

CommandDescription
/DetectNowDetect and download available updates
/ReportNowReport status back to WSUS server
/ResetAuthorizationClear update check cookie (fixes 1-hour delay)
/UpdateNowInstall updates immediately
/ShowSettingsDialogDisplay Windows Update settings

Common WUAUCLT Examples

# Detect and install updates immediately
wuauclt /detectnow /updatenow

# Reset authorization cookie if updates are stuck
wuauclt /resetauthorization

# Report client status to WSUS server
wuauclt /reportnow

WSUS Integration and Enterprise Management

Windows Server Update Services (WSUS) provides centralized update management for enterprise environments. Understanding WSUS client commands is essential for troubleshooting and maintaining proper update deployment.

WSUS Client Configuration

Verify and configure WSUS server settings using registry keys and PowerShell commands.

# Check configured WSUS server
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name WUServer

# Check WSUS status server
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name WUStatusServer

# View all WSUS-related registry settings
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"

# Force immediate check-in with WSUS server
wuauclt /reportnow

# Reset and re-register with WSUS
wuauclt /resetauthorization /detectnow

WSUS Client Registration Issues

Fix duplicate SUSclientID issues and force client re-registration with WSUS servers.

# Stop Windows Update service
Stop-Service wuauserv

# Remove duplicate SUSclientID (fixes registration issues)
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" -Name SusClientId -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" -Name SusClientIdValidation -ErrorAction SilentlyContinue

# Clear authorization token
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" -Name AccountDomainSid -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" -Name PingID -ErrorAction SilentlyContinue

# Restart service and force re-registration
Start-Service wuauserv
wuauclt /resetauthorization /detectnow

# Verify new client ID was generated
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" -Name SusClientId

WSUS with PowerShell

Use PSWindowsUpdate module with WSUS servers for advanced management capabilities.

# Add WSUS as update source
Add-WUServiceManager -ServiceID "3da21691-e39d-4da6-8a4b-b43877bcb1b7" -Confirm:$false

# List updates from WSUS server
Get-WUList -ServiceID "3da21691-e39d-4da6-8a4b-b43877bcb1b7"

# Install updates from WSUS
Get-WUInstall -ServiceID "3da21691-e39d-4da6-8a4b-b43877bcb1b7" -AcceptAll

# Remove WSUS service (switch back to Microsoft Update)
Remove-WUServiceManager -ServiceID "3da21691-e39d-4da6-8a4b-b43877bcb1b7"

💡 Pro Tip: Understanding WSUS vs Microsoft Update

WSUS allows organizations to approve and control which updates are deployed. When a computer is configured to use WSUS, it will only see updates approved by your WSUS administrator. The /ReportNow command forces the client to immediately report its status to the WSUS server, which is essential for accurate reporting and compliance tracking.

Tool Comparison and Best Practices

Understanding which Windows Update tool to use for your environment ensures optimal update management efficiency and reliability.

ToolBest ForAdvantagesLimitations
WUAUCLTLegacy systems (Win 7, Server 2012R2)Simple, built-inDeprecated, limited features
USOClientModern Windows (10+, Server 2016+)Native, reliableBasic functionality only
PowerShellAdvanced automation, enterpriseFlexible, scriptable, detailed controlRequires module installation

💡 Best Practices for Windows Update Management

  • Always run update commands from an elevated/administrative prompt
  • Test updates in a non-production environment first
  • Schedule updates during maintenance windows to minimize disruption
  • Monitor update installation progress and logs for errors
  • Implement a rollback strategy for critical systems
  • Use PowerShell for enterprise environments requiring detailed control

Troubleshooting Common Issues

Resolve Windows Update failures with comprehensive troubleshooting commands and error code resolution guides.

Reset Windows Update Components

# Complete reset using PowerShell
Stop-Service wuauserv, cryptSvc, bits, msiserver

# Clear update cache directories
Remove-Item C:\Windows\SoftwareDistribution -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item C:\Windows\System32\catroot2 -Recurse -Force -ErrorAction SilentlyContinue

# Restart services
Start-Service wuauserv, cryptSvc, bits, msiserver

# Alternative: Use PSWindowsUpdate module
Reset-WUComponents

Common Windows Update Error Codes

Error CodeDescriptionSolution
0x80070002File not foundClear SoftwareDistribution folder
0x80070003System cannot find pathReset Windows Update components
0x8024402FConnection to update server failedCheck internet connection, proxy, firewall
0x80240034Update not applicableUpdate already installed or wrong version
0x80244007Server not foundVerify WSUS configuration or internet access
0x80244019Exceeded maximum redirectsReset Windows Update authorization
0x8024401CConnection closedCheck network stability, run wuauclt /resetauthorization

Error Resolution Commands

# Fix 0x8024402F (connection failures)
netsh winhttp reset proxy
netsh winsock reset
ipconfig /flushdns

# Fix 0x80244019 (too many redirects)
wuauclt /resetauthorization
wuauclt /detectnow

# Check and repair system files
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth

# View detailed Windows Update log
Get-WindowsUpdateLog

# Check specific error in Event Viewer
Get-WinEvent -LogName System -MaxEvents 100 | Where-Object {$_.Id -in @(20,21,22,24,25)} | Format-Table TimeCreated, Id, Message -AutoSize

Diagnostic Commands

# Check Windows Update service status
Get-Service wuauserv, bits, cryptsvc | Format-Table Name, Status, StartType

# Check update installer status (PowerShell)
Get-WUInstallerStatus

# View pending updates and their status
Get-WindowsUpdate -Verbose

# Check last successful update check
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Detect" | Select-Object LastSuccessTime

# Verify update history with exit codes
Get-WUHistory | Where-Object {$_.Result -ne "Succeeded"} | Format-Table Date, Title, Result -AutoSize

# Test connectivity to Microsoft update servers
Test-NetConnection -ComputerName "update.microsoft.com" -Port 443
Test-NetConnection -ComputerName "download.windowsupdate.com" -Port 443

Advanced Troubleshooting Script

Comprehensive PowerShell script for deep troubleshooting and repair.

# Complete Windows Update troubleshooting script
Write-Host "Stopping Windows Update Services..." -ForegroundColor Yellow
Stop-Service wuauserv, bits, cryptsvc, msiserver -Force

Write-Host "Clearing update cache..." -ForegroundColor Yellow
Remove-Item C:\Windows\SoftwareDistribution\* -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item C:\Windows\System32\catroot2\* -Recurse -Force -ErrorAction SilentlyContinue

Write-Host "Re-registering DLL files..." -ForegroundColor Yellow
$dlls = @("wuaueng.dll","wuapi.dll","wups.dll","wups2.dll","wuwebv.dll","wucltux.dll")
foreach ($dll in $dlls) {
    regsvr32 /s $dll
}

Write-Host "Resetting network components..." -ForegroundColor Yellow
netsh winsock reset
netsh winhttp reset proxy

Write-Host "Restarting services..." -ForegroundColor Yellow
Start-Service wuauserv, bits, cryptsvc, msiserver

Write-Host "Forcing update detection..." -ForegroundColor Yellow
wuauclt /resetauthorization /detectnow

Write-Host "Troubleshooting complete!" -ForegroundColor Green

Advanced Use Cases and Automation

Real-world scenarios and automation examples for enterprise Windows update management.

Bulk Server Update Deployment

Deploy updates across multiple servers with progress monitoring and reporting.

# Define server list
$servers = Get-Content "C:\servers.txt"

# Install updates on all servers with progress tracking
$results = @()
foreach ($server in $servers) {
    Write-Host "Processing $server..." -ForegroundColor Cyan
    try {
        $result = Invoke-WUJob -ComputerName $server -Script {
            Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot
        } -RunNow -Confirm:$false

        $results += [PSCustomObject]@{
            Server = $server
            Status = "Success"
            Time = Get-Date
        }
    } catch {
        $results += [PSCustomObject]@{
            Server = $server
            Status = "Failed: $($_.Exception.Message)"
            Time = Get-Date
        }
    }
}

# Export results to CSV
$results | Export-Csv "C:\UpdateResults.csv" -NoTypeInformation

Maintenance Window Automation

Create automated maintenance windows with pre/post-update checks and rollback capability.

# Maintenance window script with safety checks
$maintenanceScript = {
    # Pre-update backup
    Write-Host "Creating system restore point..." -ForegroundColor Yellow
    Checkpoint-Computer -Description "Before Windows Updates $(Get-Date)" -RestorePointType MODIFY_SETTINGS

    # Check available disk space
    $disk = Get-PSDrive C
    if ($disk.Free -lt 10GB) {
        Write-Host "Insufficient disk space! Aborting." -ForegroundColor Red
        exit 1
    }

    # Install updates
    Write-Host "Installing updates..." -ForegroundColor Yellow
    $updates = Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot -Verbose

    # Post-update verification
    Write-Host "Verifying installation..." -ForegroundColor Yellow
    $failed = Get-WUHistory -Last 10 | Where-Object {$_.Result -eq "Failed"}

    if ($failed) {
        Write-Host "Some updates failed. Review required." -ForegroundColor Red
        $failed | Format-Table Date, Title, Result
    } else {
        Write-Host "All updates installed successfully!" -ForegroundColor Green
    }

    # Schedule reboot
    Write-Host "Scheduling reboot for 3 AM..." -ForegroundColor Yellow
    shutdown /r /t 3600 /c "System will reboot in 1 hour for updates"
}

# Execute during maintenance window
Invoke-Command -ComputerName "ProductionServer" -ScriptBlock $maintenanceScript

Update Compliance Reporting

Generate comprehensive update compliance reports for management and audit purposes.

# Generate compliance report for all servers
$servers = Get-Content "C:\servers.txt"
$report = @()

foreach ($server in $servers) {
    $pending = Get-WUList -ComputerName $server -MicrosoftUpdate
    $lastUpdate = Get-WUHistory -ComputerName $server -Last 1

    $report += [PSCustomObject]@{
        ServerName = $server
        PendingUpdates = $pending.Count
        LastUpdateDate = $lastUpdate.Date
        LastUpdateTitle = $lastUpdate.Title
        RebootRequired = (Get-WURebootStatus -ComputerName $server).RebootRequired
        ComplianceStatus = if ($pending.Count -eq 0) {"Compliant"} else {"Non-Compliant"}
    }
}

# Export to HTML report
$report | ConvertTo-Html -Title "Windows Update Compliance Report" |
    Out-File "C:\ComplianceReport.html"

# Email report to management
Send-MailMessage -To "[email protected]" -From "[email protected]" `
    -Subject "Monthly Update Compliance Report" -Body "See attached" `
    -Attachments "C:\ComplianceReport.html" -SmtpServer "smtp.company.com"

Offline Update Installation

Deploy updates on systems without internet connectivity using offline MSU packages.

# Download updates for offline installation
Get-WUOfflineMSU -DestinationPath "C:\OfflineUpdates" -AcceptAll

# Install from MSU files on offline system
$msuFiles = Get-ChildItem "C:\OfflineUpdates\*.msu"
foreach ($msu in $msuFiles) {
    Write-Host "Installing $($msu.Name)..." -ForegroundColor Cyan
    Start-Process wusa.exe -ArgumentList "$($msu.FullName) /quiet /norestart" -Wait
}

# Alternative: Use DISM for offline servicing
DISM /Online /Add-Package /PackagePath:"C:\OfflineUpdates\update.cab"

Version-Specific Considerations

Important compatibility notes and version-specific behaviors for different Windows releases.

🔔 Windows 11 (23H2 / 24H2)

  • USOClient commands work identically to Windows 10
  • Enhanced Windows Update settings in System Settings
  • Improved update rollback capabilities within 10 days
  • New Get-WindowsUpdateLog generates ETL format by default
  • Better handling of driver updates through Windows Update

💻 Windows 10 Versions

  • 1507-1607: USOClient may not be available; use WUAUCLT or PowerShell
  • 1703+: USOClient fully supported and recommended
  • 20H2+: All modern update commands work reliably
  • LTSC 2019/2021: Different update cadence, test thoroughly before deployment

🖥️ Windows Server

  • Server 2025: Latest USOClient and PowerShell features fully supported
  • Server 2022/2019/2016: Use USOClient or PowerShell (preferred)
  • Server 2012 R2: WUAUCLT only; PSWindowsUpdate module highly recommended
  • Server Core: Command-line only; PowerShell module essential for management
  • Note: Windows Server typically requires manual reboot approval

⚠️ Compatibility Warnings

  • Not all Windows 10/11 versions support usoclient scaninstallwait
  • Some LTSC and LTSB versions have limited USOClient functionality
  • Always test update commands in dev environment before production use
  • Group Policy settings can override command-line update behaviors
  • Third-party security software may interfere with update processes

Frequently Asked Questions

Find answers to common questions

Execution policy blocks scripts—run 'Set-ExecutionPolicy RemoteSigned' as admin. PSWindowsUpdate module missing—install with 'Install-Module PSWindowsUpdate' (requires PowerShell 5+). WSUS configured: enterprise machines often have update sources locked down by Group Policy. UsoClient.exe location varies: it's in System32 on Windows 10/11, missing on Windows 7. Service stopped: Windows Update service must be running. Check with 'Get-Service wuauserv'. Most common: UAC prompts require admin rights—always run as administrator.

Need Expert IT & Security Guidance?

Our team is ready to help protect and optimize your business technology infrastructure.