############################################################### # # Scriptname: Get-WUReport.ps1 # # Source: several internet blogs # Date: unknown # # Version: 2023.08.01 / 18.08.23 / Urs Heeb # Script created to run on a client itself # # # Description: Script does following: # Brings the Windows update client into a proper report mode # Send an update report to the WSUS # # Requirements: # Service user should be SYSTEM # WU/WSUS has to be configured by GPO # ############################################################### # Prepare WU engine for the next report run $updateSession = new-object -com "Microsoft.Update.Session";$updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates # Give the system to complete the wuauserv queue Start-sleep -seconds 10 # Detect new updates wuauclt /detectnow (New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() # Report the status to the WSUS wuauclt /reportnow c:\windows\system32\UsoClient.exe startscan