当使用WMI :

        ConnectionOptions connectionOptions = new ConnectionOptions();
            connectionOptions.Username = userName;
            connectionOptions.Password = password;
            ManagementScope managementScope = new ManagementScope("\\\\" + host + "\\root\\cimv2", connectionOptions);
            try
            {
                managementScope.Connect();
            }
            catch
            {
            }

 发生"RPC 服务器不可用"或者其它无法连接的情况下(确保连接本机没有问题)的解决方案:

1 检查远程服务器 “Remote Procedure Call”、“DCOM Server Process Launcher” 和 “DHCP Client”服务 是否开启

2  检查远程服务器 本地安全策略--本地策略--安全选项--网络访问:本地帐户的共享和安全模式--属性 选择:经典-本地用户以自己的身份验证

3  在远程服务器上,运行"netsh firewall set service RemoteAdmin".

 

相关文章:

  • 2021-12-02
  • 2021-05-16
  • 2022-01-10
  • 2022-12-23
  • 2022-02-16
  • 2021-11-15
  • 2021-09-18
猜你喜欢
  • 2021-05-26
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2021-08-14
相关资源
相似解决方案