Windows Update Agent script to list installed updates reporting no installed updates

Hello, i have an issue on multiple Windows 2008 R2 Servers.

When running the following demonstration VBS script (powershell equivalent is behaving the same) :

'----------LIST INSTALLED UPDATES-------------

Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

WScript.Echo "Searching for updates..." & vbCRLF

Set searchResult = updateSearcher.Search("IsInstalled=1")

msgbox searchresult.updates.count

In 90% of our servers the API reports a count of 0 updates.

However the searchhistory method returns hundred of updates, so obviously there is something wrong going on...

I tried several things : check for resultcode (returns 2, means success), tried various search filters, tried online=true and online=false.

Same result, 0.

However Windows 7 does not display the same issue.

Somebody could explain or reproduce the issue ?

PS : the updates are managed in our environment by SCE 2010

December 11th, 2012 3:21pm

Hi,


For this VBScript problem, I suggest you post in Script forum
http://social.technet.microsoft.com/Forums/en/category/scripting

Free Windows Admin Tool Kit Click here and download it now
December 12th, 2012 6:04am

Try with my free utility: www.portableupdate.com, looking at "History" tab or setting criteria "IsInstalled=1" to the setting tab, and good luck!

Gigirex


  • Edited by Luigi Stilo Sunday, January 06, 2013 6:41 PM
January 6th, 2013 6:40pm

The command line tool WuInstall can do both ... try WuInstall /search and WuInstall /search /criteria "IsInstalled=1", with the xmlout option you can also put all the data of the updates found to an xml file for further procesing.

check http://www.wuinstall.com for documentation and download

  • Edited by DonkeyCat 13 hours 40 minutes ago
Free Windows Admin Tool Kit Click here and download it now
April 17th, 2015 1:23pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics