473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Time limit on ManagementScope.Connect?

Hello, is there a way to limit the time a "ManagementScope.Connect"
execution takes to end before it times out by itself? I tried using
ConnectionOptions.TimeOut property to no avail.

I am trying with the code below to scan a group of computers, but there are
still a few computers that take way more than two seconds to time out.

Please, any help or pointers will be greatly appreciated.

Dim options As New ConnectionOptions
Dim query As ObjectQuery
Dim searcher As ManagementObjectSearcher
Dim queryCollection As ManagementObjectCollection
Dim m As ManagementObject
Dim scope As New ManagementScope("\\" & oName & "\root\cimv2", options)
Try
scope.Options.Timeout = New TimeSpan(20000000)
scope.Connect()
Catch ex As System.UnauthorizedAccessException
oMsg &= "Connect UnauthorizedAccessException: " & ex.Message
Exit Sub
Catch ex As System.Runtime.InteropServices.COMException
oMsg &= "Connect COMException: " & ex.Message
Exit Sub
End Try

Regards,

federico
Oct 6 '08 #1
0 2411

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: PW | last post by:
Hi, I'm using WinXP-Pro, ASP classic, IIS 5.0. I regularly get this error, but I know I am the only user accessing the website at the time of the error. I looked it up on the MS support...
3
by: Gary | last post by:
Hi, guys! Some of my applications are sharing same SQL login/password to connect to a database called "MyDB" on server "MyServer" . The password is encrypted and stored in registry or some...
5
by: toupeira23 | last post by:
Hello I'm trying to connect to another server via WMI, and it works just fine. But everytime it first tries to connect with the current user credentials, which naturally don't exist on the...
21
by: rdemyan via AccessMonster.com | last post by:
Is there a way to get the internet date/time. I saw an article that uses WinSock, but WinSock doesn't seem to be available in Access. I want to verify that the date/time on the local PC running...
9
by: Adrian Dev | last post by:
Hi, I have succesfully used a ManagementScope object to get WMI information about workstations on the current domain using "//xp10/root/cimv1". But if I make a request to a workstation on a...
3
by: William Cruz | last post by:
Is there a way to get the current date / time on a remote PC? William *** Sent via Developersdex http://www.developersdex.com ***
33
by: desktop | last post by:
In the C++ standard sec 23.1.2 table 69 it says that erase(q) where q is a pointer to an element can be done in amortized constant time. I guess that is not worst case since std::set is...
0
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i'm working with WMI and trying to collect a remote machine network shares. i recalled that this did work. but maybe a MS hotfix put an end to this. i cannot seem to get the remote machine data...
0
by: federico | last post by:
Hello, is there a way to limit the time a "ManagementScope.Connect" execution takes to end before it times out by itself? I tried using ConnectionOptions.TimeOut property to no avail. I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.