|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help with WMI error message - "The object exporter specified was not found"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 *** 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 -- Show quoteHide quoteNewbie Coder (It's just a name) "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 ***
Process.Start woes in ASP.Net application
regular expression question Row Update Not Updating Data source System tray icon does not always show when starting app when Windows starts Best method to parse this flat file Drawing One Simple Little Line File.OpenWrite vs StreamWriter Suggestions to learn vb.net Access DB Upgrade get DB results from inner join update |
|||||||||||||||||||||||