Why the Windows Update API is not giving correct list of installed patches in device

Ramya G 0 Reputation points
2023-11-15T10:30:14.2766667+00:00

I'm using below query to get installed patches

New-Object -ComObject Microsoft.Update.Session).CreateupdateSearcher().Search("IsInstalled=1").Updates | Select-Object Title

I'm comparing the results with control panel. Control panel is listing more patches compared to above query.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,576 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,391 Reputation points
    2023-11-15T16:44:12.62+00:00

    Have you tried using the PSWindowsUpdate module? https://www.powershellgallery.com/packages/PSWindowsUpdate/2.2.0.2

    I think the API you referenced only reports on patches installed using MSI.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.