Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to find out the remote system information over LAN by using the ip address of that system. But i am not able to getting the information. i am using the following code but i am getting the error.

C#
try
            {
                ObjectQuery queryObj = new ObjectQuery("SELECT * FROM Msvm_ComputerSystem");
                ConnectionOptions connOpts = new ConnectionOptions();
                connOpts.Username = "********";
                connOpts.Authority = "ntlmdomain:" + "*******";
                connOpts.Password = "*********";
                ManagementScope manScope = new ManagementScope(@"\\RemoteSystem\root\virtualization", connOpts);

                // connect and set up our search
                ManagementObjectSearcher vmSearcher = new ManagementObjectSearcher(manScope, queryObj);
                ManagementObjectCollection vmCollection = vmSearcher.Get();
                foreach (ManagementObject vm in vmCollection)
                {
                    MessageBox.Show(vm["ElementName"].ToString());
                    
                }


            }


I am getting the following error

{System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

how can i solve this issue....
Posted
Updated 27-May-12 17:56pm
v2
Comments
Sergey Alexandrovich Kryukov 28-May-12 0:47am    
Well, and did you set up an RPC (Remote Procedure Call) on the remote system?
--SA

1 solution

Please see my comment to the question. Remote system information cannot be obtained without collaboration with some software on the other side. In this case, you are supposed to run the RPC (Remote Procedure Call) server on the remote machine, please see:
http://en.wikipedia.org/wiki/Remote_procedure_call[^].

Please see this article covering many issues related to RPC: http://social.technet.microsoft.com/wiki/contents/articles/4494.troubleshooting-the-rpc-server-is-unavailable.aspx[^].

—SA
 
Share this answer
 
Comments
Abhinav S 28-May-12 0:51am    
Good answer. 5.
Sergey Alexandrovich Kryukov 28-May-12 0:53am    
Thank you, Abhinav.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900