连接到其他域上的VM时出错

时间:2017-06-26 18:35:23

标签: c# wmi

这个代码在打开另外两个虚拟机时工作正常但是给我一个RPC错误 在不同的域上打开计算机。目前我正在使用ConnectionOptions类连接到远程计算机

`options.Username = dif_users[i];  // Assume correct user name
        options.Password = dif_passwords[i]; // Assume correct password
        if (i == 2) // To execute for the third VM. (i = 0 in the beginning)
        {
            //
            options.Authentication = AuthenticationLevel.Packet;
            options.Impersonation = ImpersonationLevel.Impersonate;
            options.EnablePrivileges = true;
            options.Authority = "ntlmdomain:DIFFERENT_DOMAIN";


        }
        ManagementScope scope = new ManagementScope("\\\\" + comps + "\\root\\cimv2", options);

        scope.Connect();  // RPC server is unavaialaible 

`

0 个答案:

没有答案