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()); } }
{System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)