Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 连接到其他域上的VM时出错_C#_Wmi - Fatal编程技术网

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

C# 连接到其他域上的VM时出错,c#,wmi,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 execu

这段代码在打开另外两个虚拟机时工作正常,但在打开时给我一个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 

`

是否在active directory中为第三个VM使用ldap或kerberos作为身份验证提供程序?连接到其他VM是否有效?kerberos在active directory中用作身份验证提供程序。与其他两个VM的连接可以工作(我认为这是因为我的计算机和其他两台计算机位于同一个域上,而第三台计算机使用另一个域)在您的权限字符串中指定“kerberos”而不是ntlmdomain您是否在active directory中为第三个VM使用ldap或kerberos作为身份验证提供程序?连接到其他VM是否有效?kerberos在active directory中用作身份验证提供程序。与其他两个VM的连接可以工作(我认为这是因为我的计算机和其他两台计算机在同一个域上,而第三台计算机使用另一个域)在您的权限字符串中指定“kerberos”而不是ntlmdomain