PowerShell
Edit|Remove
Write-Host "" 
$WUSettingsNoAutoUpdate = "" 
$WUSettingsNoAutoUpdate = (Get-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -ErrorAction SilentlyContinue).NoAutoUpdate 
$WUSettingsAUOptions = "" 
$WUSettingsAUOptions = (Get-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -ErrorAction SilentlyContinue).AUOptions 
$WSUSSetting = "" 
$WSUSSetting = (Get-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" -ErrorAction SilentlyContinue).UseWUServer 
$WSUSSettingWUServer = "" 
$WSUSSettingWUServer = (Get-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).WUServer 
$WUfBSettingBranchLocal = "" 
$WUfBSettingFULocal = "" 
$WUfBSettingQULocal = "" 
$WUfBSettingBranchLocal = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -ErrorAction SilentlyContinue).BranchReadinessLevel 
$WUfBSettingFULocal = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -ErrorAction SilentlyContinue).DeferFeatureUpdatesPeriodInDays 
$WUfBSettingQULocal = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -ErrorAction SilentlyContinue).DeferQualityUpdatesPeriodInDays 
$WUfBSettingBranch = "" 
$WUfBSettingFU = "" 
$WUfBSettingQU = "" 
$WUfBSettingFUdays = "" 
$WUfBSettingQUdays = "" 
$WUfBSettingBranch = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).BranchReadinessLevel 
$WUfBSettingFU = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).DeferFeatureUpdates 
$WUfBSettingQU = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).DeferQualityUpdates 
$WUfBSettingFUdays = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).DeferFeatureUpdatesPeriodInDays 
$WUfBSettingQUdays = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -ErrorAction SilentlyContinue).DeferQualityUpdatesPeriodInDays 
$ConfigMgrClient = "" 
$ConfigMgrClient = (Get-WmiObject -Query "Select * from __Namespace WHERE Name='CCM'" -Namespace root -ErrorAction SilentlyContinue) 
 
if ($WSUSSetting -eq "1") { 
    $EffectiveWSUS = "enabled" 
} else { 
    $EffectiveWSUS = "disabled" 
} 
if ((($WUfBSettingFULocal -eq "0"-and ($WUfBSettingQULocal -eq "0")) -or (($WUfBSettingFULocal.Length -eq 0) -and ($WUfBSettingQULocal.Length -eq 0))) { 
    $EffectiveWUfBLocal = "disabled" 
} else { 
    $EffectiveWUfBLocal = "enabled" 
} 
if (($WUfBSettingFU -eq "1"-or ($WUfBSettingQU -eq "1")) { 
    $EffectiveWUfBPolicy = "enabled" 
} else { 
    $EffectiveWUfBPolicy = "disabled" 
} 
if (($EffectiveWSUS -eq "enabled"-and ($EffectiveWUfBLocal -eq "enabled"-and ($EffectiveWUfBPolicy -eq "enabled")) { 
    $EffectiveWSUS = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
    $EffectiveWUfBLocal = "* this setting has no effect. " 
    $EffectiveWUfBPolicy = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
} elseif (($EffectiveWSUS -eq "enabled"-and ($EffectiveWUfBLocal -eq "enabled")) { 
    $EffectiveWSUS = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
    $EffectiveWUfBLocal = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
    $EffectiveWUfBPolicy = "" 
} elseif (($EffectiveWSUS -eq "enabled"-and ($EffectiveWUfBPolicy -eq "disabled")) { 
    $EffectiveWSUS = "* This setting is effective. " 
    $EffectiveWUfBLocal = "" 
    $EffectiveWUfBPolicy = "" 
} elseif (($EffectiveWSUS -eq "enabled"-and ($EffectiveWUfBPolicy -eq "enabled")) { 
    $EffectiveWSUS = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
    $EffectiveWUfBLocal = "" 
    $EffectiveWUfBPolicy = "* WSUS and WUfB settings are mixed. This state is not recommended. " 
} elseif (($EffectiveWUfBLocal -eq "enabled"-and ($EffectiveWUfBPolicy -eq "enabled")) { 
    $EffectiveWSUS = "" 
    $EffectiveWUfBLocal = "* this setting has no effect. " 
    $EffectiveWUfBPolicy = "* This setting is effective. " 
} else { 
    $EffectiveWSUS = "" 
    $EffectiveWUfBLocal = "" 
    $EffectiveWUfBPolicy = "" 
} 
 
# Check WU Settings 
if ($WUSettingsNoAutoUpdate.Length -eq 0) { 
    Write-Host "Windows Update (Policies): Not Configured (Windows 10 default is automatic)" 
} else { 
      if ($WUSettingsNoAutoUpdate -eq "1") { 
        Write-Host "Windows Update (Policies): Manual (Disabled)" 
    } elseif ($WUSettingsAuOptions -eq "3") { 
        Write-Host "Windows Update (Policies): Download only" 
    } elseif ($WUSettingsAuOptions -eq "4") { 
        Write-Host "Windows Update (Policies): Automatic" 
    } else { 
        Write-Host "Windows Update (Policies): Custom" 
    } 
    Write-Host "  (This setting is in Computer Configuration\Adminisrative Template\Windows Component\Windows Update\Configure Automatic Updates. )" 
 
} 
Write-Host "" 
# Check WSUS Settings 
if ($WSUSSetting.Length -eq 0) { 
    Write-Host "WSUS Client: Not Configured" 
} else { 
    if ($WSUSSetting -eq "0") { 
        Write-Host "WSUS Client: Disabled" 
    } else { 
        Write-Host "WSUS Client: Enabled" 
        Write-Host "  WSUS Server:" $WSUSSettingWUServer 
    } 
    Write-Host "  ("$EffectiveWSUS"This setting is in Computer Configuration\Adminisrative Template\Windows Component\Windows Update\Specify intranet Microsoft update service location.)" 
} 
Write-Host "" 
# Check Local WUfB Settings 
if ((($WUfBSettingFULocal -eq "0"-and ($WUfBSettingQULocal -eq "0"-and ($WUfBSettingBranchLocal -eq "16")) -or (($WUfBSettingFULocal.Length -eq 0) -and ($WUfBSettingQULocal.Length -eq 0)) -or ($WUfBSettingBranchLocal.Length -eq 0)) { 
    Write-Host "Windows Update for Business (Settings app): Not Configured" 
} else { 
    Write-Host "Windows Update for Business (Settings app): Enabled" 
    if ($WUfBSettingBranchLocal -eq "16") { 
        Write-Host "  Update Channel: SAC"  
        } elseif ($WUfBSettingBranchLocal -eq "32") { 
        Write-Host "  Update Channel: SAC-T (for 1809 and below only)"  
    } else { 
        Write-Host "  Update Channel: Preview Build"  
    } 
    Write-Host "  After a feature update is released, defer receiving it for this days:" $WUfBSettingFULocal 
    Write-Host "  After a quality update is released, defer receiving it for this days:" $WUfBSettingQULocal 
    Write-Host "  ("$EffectiveWUfBLocal"These settings are in Settings > Update & Security > Windows Update > Advanced Options > Chose when updates are installed. (Hidden in WSUS client))" 
} 
Write-Host "" 
# Check WUfB Settings Policies 
if (($WUfBSettingFU -eq "1"-or ($WUfBSettingQU -eq "1")) { 
    Write-Host "Windows Update for Business (Policies): Enabled" 
        if ($WUfBSettingBranch.Lengsh -eq 0) { 
        Write-Host "  Update Channel: Not Confiured" 
        Write-Host "  After a feature update is released, defer receiving it for this days: Not Configured" 
        } else { 
        if ($WUfBSettingBranch -eq "32") { 
            Write-Host "  Update Channel: SAC-T (for 1809 and below only)"  
        } else { 
            Write-Host "  Update Channel: Preview Build"  
        } 
        Write-Host "  After a feature update is released, defer receiving it for this days:" $WUfBSettingFUdays 
        } 
    if ($WUfBSettingQU.Length -eq 0){ 
        Write-Host "  After a quality update is released, defer receiving it for this days: Not Configured" 
    } else { 
        Write-Host "  After a quality update is released, defer receiving it for this days:" $WUfBSettingQUdays 
    } 
    Write-Host "  ("$EffectiveWUfBPolicy"These settings are in Computer Configuration\Adminisrative Template\Windows Component\Windows Update\Windows Update for Business.)" 
} else { 
    Write-Host "Windows Update for Business (Policies): Not Configured" 
} 
Write-Host "" 
# Check ConfigMgr Client 
if (($ConfigMgrClient.Length -ne 0) -and (Test-Path "C:\Windows\CCMSETUP")) { 
    Write-Host "***************************************************************************" 
    Write-Host "* This device may be managed by Microsoft Endpoint Configuration Manager. *" 
    Write-Host "***************************************************************************" 
} 
Write-Host "" 
$WinVer = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId 
$WinBuild = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuild 
$WinRev = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").UBR 
Write-Host "Current update status: version"$WinVer", build" $WinBuild"."$WinRev 
Write-Host "" 
Write-Host "(Note: This script does not support the identification of devices managed by Microsoft Intune or other update tools.)" 
Write-Host ""
Description
This powershell script collects Windows Update related settings for Windows 10 ver 1703 or higher and Windows Server 2016 or higher from local registory. the following settings and their validity are shown.
- Automatic Update configuration
- Windows Server Update Services (WSUS) client configuration
- Windows Update for Business (WUfB) local configuration by Settings app
- Possibility of mnaged device by Microsofft Endpoint Configuration Manager (formerly System Center configuration Manager)
Extract get-wusettings_v3.zip and run
.\get-wusettings.ps1
(get-wusettingsj.ps1 for Japanese environment.)

 

Output sample

C:\scripts> .\get-wusettings.ps1

Windows Update (Policies): Not Configured (Windows 10 default is automatic)

WSUS Client: Not Configured

Windows Update for Business (Settins app): Enabled

  After a feature update is released, defer receiving it for this days: 30

  After a quality update is released, defer receiving it for this days: 7

  ( These settings are in Settings > Update & Security > Windows Update > Advanced Options > Chose when updates are installed. (Hidden in WSUS client))

Windows Update for Business (Policies): Not Configured

(Note: This script does not support the identification of devices managed by Microsoft Intune or other update tools.)

C:\scripts>

 

Change history

get-wusettings_v3.zip --- Add current update status (version and build.rev number) and bug fix

get-wusettings_v2.zip --- Add support for Windows 10 ver 1703 to 1809 local SAC(fomerly Current Branch) / SAC-T (fomerly Current Branch for Business) setting.