Windows/WSUS: Force desktop to re-sync with WSUS server

Created: 8-25-21

Updated: 8-25-21

Here is a useful script that rehashes the WSUS setting for a Windows 10 desktop in the event windows updates stop polling updates from WSUS:

Stop-Service -Name BITS, wuauserv -Force
Remove-ItemProperty -Name AccountDomainSid, PingID, SusClientId, SusClientIDValidation -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\ -ErrorAction SilentlyContinue
Remove-Item “$env:SystemRoot\SoftwareDistribution\” -Recurse -Force -ErrorAction SilentlyContinue
Start-Service -Name BITS, wuauserv
wuauclt /resetauthorization /detectnow
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()