none
C# WMI The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) RRS feed

  • Question

  • Hi All,

    I m using the WMI to retrieve windows services from other servers remotely. It works for most of the machines, but not the others, and this is the error throws for those machines: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

    I can confirm the port 135 (for RPC) is opened on all of the servers, can someone sheds me a light on what else could be the issue?

    Many thanks.

    Andie.

    Wednesday, February 20, 2013 12:34 AM

Answers

All replies

  • Hi Andie,

    Welcome to the MSDN Forum.

    Would you like to try this troubleshooting: http://social.technet.microsoft.com/wiki/contents/articles/4494.troubleshooting-the-rpc-server-is-unavailable.aspx 

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 21, 2013 4:35 PM
    Moderator
  • Thanks Mike,

    the issue actualy been isoloated, it is due to my application sits on a different subnet of the targeting servers.

    e.g.  the server IP where my app sits: 10.54.100.xx and the target server IP: 10.54.129.xx.

    is there a way to get the required info across different subnet without opening an extra port?

    Monday, February 25, 2013 12:09 AM
  • Hi Audie,

    Please take a look at this similar thread: http://serverfault.com/questions/312096/wmi-query-between-two-different-ad-sites 

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 25, 2013 6:57 AM
    Moderator
  • I faced same error and found a solution by opening the Group Policy Object Editor (gpedit.msc) and edited the Group Policy object (GPO) that is used to manage Windows Firewall settings.

    Open Computer Configuration -> Administrative Templates -> Network -> Network Connections -> Windows Firewall -> Domain Profile & Standard Profile.

    Here enable the following exceptions: "Allow inbound remote administration exception" and "Allow inbound file and printer sharing exception".


    ~manoj | email: http://scr.im/m22g
    http://sqlwithmanoj.wordpress.com
    MCCA 2011 | My FB Page

    Monday, May 6, 2013 6:04 PM
  • Hi,


    I am facing an issue with a virtual machine in Hyper-V. The setup is as mentioned below:

     

    1. I have a virtual machine (named HV4), it contains Windows 2012 Server. Hyper-V Manager is enabled on this machine.
    2. There are more than one virtual machines under Hyper-V Manager (HV4 nested) . All machines contains Windows 2012 Server.
    3. All the machine are connected with External switch and assigned the IP 192.168.x.x. series.

     

     

    The description of the issue is as below:

    Now I want to get list of names of all network adapters of each Virtual Machine like;  NetConnectionID  (Local Area Connection1, Local Area Connection 2 etc.. ) using C#,WMI (Windows Management Instrumentation) with using System.Management;

     

    I am using CIM_NetworkAdapter Class (http://msdn.microsoft.com/en-us/library/aa387931%28v=vs.85%29.aspx).

     

    1. When the name of the virtual machine in Hyper-V Manager and Computer name of that machine is same then its working fine.
    2. If I change the Computer name of virtual machine then I get an error Message : “The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)”. But it  works fine in the above case (i.e. case 1).

     

    The used code is given below:

     

    private void GetNetAdapterInfo()

            {

                string strVirtualMachineName = string.Empty;

                StringBuilder strEthernet = new StringBuilder();

                try

                {

                    //create a management scope object

                    ManagementScope scope = new ManagementScope("\\\\VM2008R2\\ROOT\\cimv2");

                    //create object query

                    ObjectQuery query = new ObjectQuery("SELECT * FROM CIM_NetworkAdapter");

     

                    //create object searcher

                    ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);

                    //get collection of WMI objects

                    ManagementObjectCollection queryCollection = searcher.Get();

                    //enumerate the collection.

                    foreach (ManagementObject m in queryCollection)

                    {

                        // access properties of the WMI object

                        foreach (PropertyData propNet in m.Properties)

                        {

                            strEthernet.Append(propNet.Name + " :\t" + propNet.Value);

                            strEthernet.Append("\n");

                        }

                    }

     

                }

                catch (Exception expGetNetAdapterInfo)

                {

                    MessageBox.Show(expGetNetAdapterInfo.GetBaseException().ToString());

                }

                MessageBox.Show(strEthernet.ToString());

            }

    Please help me

    Thanks & Regards

    Alok kumar sharma


    Alok kumar sharma

    Friday, May 17, 2013 4:01 PM