Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WMI Timeout possible?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2236
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI Timeout possible?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WMI Timeout possible? - 3/3/2005 2:22:04 PM   
  Mooky

 

Posts: 1
Score: 0
Joined: 3/3/2005
From:
Status: offline
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 this forum regularly...

keith AT indigotechnologies DOT us

Thanks!
 
 
Post #: 1
 
 Re: WMI Timeout possible? - 3/3/2005 4:53:13 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Happens to me quite often with 3500+ machines.

Oh well..

(in reply to Mooky)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WMI Timeout possible? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts