Help with WMI error message - "The object exporter specified was not found"

W

William Cruz

Can anyone help me with this piece of code. - I keep on getting the
error message "The object exporter specified was not found"

If i change it to run on my local machine it works fine, the problem
occurs when trying to connect to a remote pc.


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
Dim connection As New ConnectionOptions
connection.Username = "the user name"
connection.Password = "the password"
connection.Authority = "ntlmdomain:the domain name"


Dim scope As New ManagementScope("\\the ip
address\root\CIMV2", connection)

scope.Connect()

Dim query As New ObjectQuery( _
"SELECT * FROM Win32_UTCTime")

Dim searcher As New ManagementObjectSearcher(scope, query)

For Each queryObj As ManagementObject In searcher.Get()

Console.WriteLine("-----------------------------------")
Console.WriteLine("Win32_UTCTime instance")
Console.WriteLine("-----------------------------------")
Console.WriteLine("DayOfWeek: {0}",
queryObj("DayOfWeek"))
Next

Close()
Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI
data: " & err.Message)
Catch unauthorizedErr As System.UnauthorizedAccessException

MessageBox.Show("Connection error (user name or password
might be incorrect): " & unauthorizedErr.Message)
End Try
End Sub

William Cruz
 
N

Newbie Coder

William,

If you reference this error you find that 2 machines may have the same IP or
the lease time is short. So, my suggestion would be to change the IP address
to the machine name & try again

What are your findings now? Will look into this problem when I get the time
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top