I've written a script which is trimmed down to the following for purpose of
discussion:

 

On error resume next

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

If err.number = 0 Then

  Set updateSearcher = updateSession.CreateupdateSearcher()

  If err.number = 0 Then

  Set searchResult = updateSearcher.Search("IsInstalled=0 and
Type='Software'")

    If err.number <> 0 Then

     wscript.echo "Error searching for updates: " & err.number

     wscript.echo "Description: " & err.description

     wscript.quit(1)

   End If

  End If

End If

 

(Never mind the "else" code for the failure of the first two setup
statements - the updateSearcher.Search is the one with the problem.)

 

Occasionally, the result is:

 

Error searching for updates: -2147012894

Description: 

 

This has happened between clients and a WSUS 2 server and between clients
that have no WSUS server defined (i.e. to the MS WU servers).

 

I've requested the windowsupdate.log file to scrutinize but so far it hasn't
been provided.

 

I'm just wondering if anyone else has seen or solved a similar problem.
Normally I would just call this "can't communicate with a WU server" but
it's happened in situations where the WSUS server was very clearly available
and responding.  Usually a second attempt at the same code will succeed.

 

thanks,

Carl


~ Upgrade to Next Generation Antispam/Antivirus with Ninja!    ~
~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm>  ~

Reply via email to