连接到远程系统时出错 [英] Error connecting to remote system

查看:68
本文介绍了连接到远程系统时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用该系统的IP地址来查找LAN上的远程系统信息.但是我无法获取信息.我正在使用以下代码,但出现错误.

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.

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....

推荐答案

请参阅我对该问题的评论.如果不与另一端的某些软件协作,则无法获得远程系统信息.在这种情况下,您应该在远程计算机上运行RPC(远程过程调用)服务器,请参阅:
http://en.wikipedia.org/wiki/Remote_procedure_call [ http://social.technet.microsoft.com/wiki/contents/articles/4494.troubleshooting-the-rpc-server-is-unavailable.aspx [
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


这篇关于连接到远程系统时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆