1

Testing the functions of wuapi.dll I noticed that some updates are not listed in the results (obviously because they are visible from the update manager).

Code used(c#):

        public ISearchResult CheckUpdates()
        {
          IUpdateSearcher uSearcher = uSession.CreateUpdateSearcher();
          uSearcher.Online = true;
          ISearchResult uResult = uSearcher.Search("Type='Software' and IsInstalled=0");
          return uResult;
        }

Also tried all possible filters combination.

Update Manager Screenshot Update Manager Screenshot

Anyone knows why? Thanks.

Tim
  • 1,153
  • 11
  • 21
t.mod
  • 11
  • 1

2 Answers2

0

Try adding this:

uSearcher.ServerSelection = ServerSelection.ssOthers;
uSearcher.ServiceID = "7971f918-a847-4430-9279-4a52d1efe18d";

And leave out the Type='Software' like Theo said.

SamK
  • 1
  • With this 2 lines of code many more updates were found, but i still can't find system updates. – t.mod Feb 01 '22 at 09:38
0

Finally I found the right filter that worked for me: IsInstalled = 0 And DeploymentAction=*

idenardi
  • 600
  • 1
  • 6
  • 20
t.mod
  • 11
  • 1