Skip to content

Instantly share code, notes, and snippets.

@bobalob
Last active July 22, 2019 10:23
Show Gist options
  • Save bobalob/09df72b1dc408bd90158861dfa0c552d to your computer and use it in GitHub Desktop.
Save bobalob/09df72b1dc408bd90158861dfa0c552d to your computer and use it in GitHub Desktop.
Temporarily disable WSUS to install App Compatibility FOD in Server 2019
# Get current WSUS setting
$existingValue = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer).UseWUServer
# Disable WSUS
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value 0
# Restart WSUS
Restart-Service wuauserv
# Install the pack
Add-WindowsCapability -Online -Name ServerCore.AppCompatibility~~~~0.0.1.0
# Set WSUS back to original setting (probably 1)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name UseWUServer -Value $existingValue
# Restart WSUS
Restart-Service wuauserv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment