Home All Groups Group Topic Archive Search About

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

Author
2 May 2007 2:35 AM
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

*** Sent via Developersdex http://www.developersdex.com ***

Author
2 May 2007 2:02 PM
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

--
Newbie Coder
(It's just a name)



Show quoteHide quote
"William Cruz" <wcru***@msn.com> wrote in message
news:%231LgUKGjHHA.4064@TK2MSFTNGP02.phx.gbl...
> 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
>
> *** Sent via Developersdex http://www.developersdex.com ***