I try to connect remote computer by using winforms c#.
My Code:
private void Form1_Load(object sender, EventArgs e)
{
var connection = new ConnectionOptions();
connection.Username = "xx";
connection.Password = "xx";
var scope = new ManagementScope("\\\\111.111.111.22:6000\\root\\CIMV2", connection);
scope.Connect(); // Exception occurs here..
}
I get below Error in line scope.Connect();
Error:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Management.dll
Additional information: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Any help will be appreciated.