Re: WMI Timeout possible?

From: TDM (tdm3)
Date: 03/04/05


Date: Fri, 4 Mar 2005 05:53:47 -0800


Mooky,

I am experiencing the very same problem and it is very annoying. I
don't have a solution for you, but I sure hope you post the fix if and
when you find one.

In my case, they script just hangs, no errors, no warnings, nothing. I
am in a recursive loop migrating registry hives from one computer to
another in a data migration script. I have yet to be able to figure out
why some systems work and others dont. The failure rate in my case
is about 10%. All the systems are set up almost exactly the same from
a standard PC image so this one is a real stumper for me.

Again, please post the fix if you find one.

TDM

"Mooky" <keith@indigotechnologies.us> wrote in message
news:1109905177.096280.179090@g14g2000cwa.googlegroups.com...
>I am using a script that collects information through WMI calls to
> remote computers on a pure Windows 2000 platform (WIn2K computers
> talking to other Win2K computers)
>
> In the script, it uses various ExecQuery calls to the objWMI object
> which I can set up successfully with either of these calls:
>
> Set objWMI = objLocator.ConnectServer(hostName,nameSpace)
> (objLocator is a WbemScripting.SWbemLocator object)
>
> -OR-
>
> Set objWMI = GetObject("winmgmts:\\" & hostName & "\" & nameSpace)
>
> It works great for the most part...when I run across a system that the
> user running the script doesn't have rights to, I get the expected
> error and can trap it accordingly.
>
> The problem is that once in a blue moon I'll hit a system that returns
> NO errors at all...in fact, it never returns from the Set objWMI call
> at all. It just hangs there indefinitly.
>
> I've read traffic about using the wbemConnectFlagUseMaxWait flag in the
> ConnectServer call, but that isn't available on the Win2K platform
> (only works in XP/2003).
>
> Any way to have this call timeout?
>
> I've thought about using asynchrnous execution instead of looping, that
> way I could simply timeout one of the instances if it doesn't return
> from the ConnectServer call...but I'm not certain how I can set up
> asynchronous execution of a whole section of code in lieu of using a
> for each loop from a dictionary object. The catch is that the code
> needs to reference several dictionary objects and make edits to an OLE
> data repository while it loops through the code. All that works
> fine...just this snag with the WMI timeout thing.
>
> The basic code does this:
>
> 1) retrieve list of systems from an OLE source
> 2) retrieve list of systems from AD and compare against list from #1
> 3) loop through all systems
> Each loop does the following
> 3.1) ping the remote system to ensure it can be reached
> 3.2) connect to the remote machines WMI service
> 3.3) collect WMI data
> 3.4) compare collected data to preexisting data from the OLE source
> 3.5) update the OLE source where necessary
> 4) report totals for updates and what not
>
> If I could figure out how to loop through the systems asynchrnously
> that would not only speed up the time it takes to execute (right now
> about 30 minutes for ~600 systems) but it would probably solve the
> issue with the WMI call getting stuck.
>
> Help anyone?
>
> and PLEASE PLEASE reply to me by eMail as I don't monitor newsgroups
> (I'm posting this through google...*sigh*)
>
> keith AT indigotechnologies DOT us
>
> Thanks!
>



Relevant Pages

  • Re: Hydra For Windows?
    ... script using perl | vbscript | wmi and loop through ... ... If you have access to a UNIX host or can boot a Linux Live CD, you could also consider modifying my very simple smbrute script: ... Cenzic Hailstorm finds vulnerabilities fast. ...
    (Pen-Test)
  • Re: Report in FM 6 or 7
    ... achieve this report format will have to be done via scripting. ... but they will simplify the script and Sort Order. ... End Loop ... The normal 'Dancer' field is used so that if there are more than one ...
    (comp.databases.filemaker)
  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: How to set up a global variable in a sub-routine?
    ... the 'global variables' are more like constants ... ... single script, I need a way to tell it only once where the file is and ... So, if you construct a loop with a loop variable, you ... >programmers avoid global variables completely. ...
    (perl.beginners)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)