UPDATED: Feb 20, 2024
We use WSUS for Windows Update with the vast majority of our corporate clients large and small and while it is usually seamless come up when it goes wrong there’s a few commands we’re always struggling to find so we decided to list them out here so we can find them easily. You like them too.
$(New-Object -ComObject "Microsoft.Update.ServiceManager").Services | Select-Object Name, IsDefaultAUService
Officially to get your Windows 10, Windows 11 and Windows Server clients to check in with WSUS you simply have to run wuauclt /reportnow,
but any tech that has done this for a few years knows how frustrating it can be to not have this command work.
For the last few years we have used two commands to really force the Windows client computers to check in with WSUS:
$updateSession = new-object -com "Microsoft.Update.Session"; $updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates
Running this command will “prime” the Windows Update engine to submit its most recent status on the next poll. To trigger that next poll, use:
https://pleasework.robbievance.net/howto-force-really-wsus-clients-to-check-in-on-demand/
wuauclt /reportnow
There are two Command Line Interface (CLI) programs to manage Windows Update so, which one you need is dependent on the version of Windows you are using.
Don’t forget to run these in an elevated command prompt.
Usoclient is the ‘new’ command line app for Window Update and it comes with many useful switches:
usoclient StartScan
: Start scanning for new patches usoclient StartDownload
: Start download of patchesusoclient StartInstall
: Install downloaded patchesusoclient RefreshSettings
: Refresh settings (i.e. check for changes)usoclient StartInteractiveScan
: Ask for user input and/or open dialogues to show progress or report errors if requiredusoclient RestartDevice
: Restart device to finish update installationusoclient ScanInstallWait
: Combined scan, download, & installusoclient ResumeUpdate
: Resume update installation after rebootingWUAUCLT.exe is the old command line app for Window Update and it comes with a few useful switches:
wuauclt /detectnow
– forces Windows to Check for Updateswuauclt /reportnow
– forces Windows to check in with its update manager (i.e. WSUS) wuauclt /updatenow
– forces Windows to install updatesThese three switches can be combined. For instance wuauclt.exe /detectnow /updatenow
should have Windows scan for new updates and then install them.
Get-WindowsUpdateLog
This command merges and converts Windows Update trace files (.etl
files) into a single human readable WindowsUpdate.log
file on your desktop named WindowsUpdate.log.
You can then open the log with Notepad and search for the word ERROR and we also like to confirm where our Windows Updates are actually coming from:
Test-NetConnection (wsus-server-name) -PORT 8530
http://(name-of-wsus-server):8530/selfupdate/iuident.cab
Change the (name-of-wsus-server)
to whatever yours is and it should download the iuident.cab file in second or two.
If this does not happen, ty using the IP address instead of the host name of your WSUS SERVER:
We used to run these steps separately but ajek has a nice little all in one script.
Step 1 – In WSUS, right click on the problematic machine and click DELETE
Step 2 – On the problematic machine, open a PowerShell as an Administrator and paste this script in all at once:
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()
Usually the results show up in a hour or two but it could take a full day. If you don’t see any change, “this was not the fix you are looking for”.
This website uses cookies.