我正在使用以下代码使用WMI连接到远程计算机:
ConnectionOptions connOptions = new ConnectionOptions();
connOptions.Impersonation = ImpersonationLevel.Impersonate;
connOptions.EnablePrivileges = true;
connOptions.Username = "admin";
connOptions.Password = "password";
ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", remoteMachine), connOptions);
scope.Connect();
Run Code Online (Sandbox Code Playgroud)
我收到以下异常:RPC服务器不可用.(HRESULT异常:0x800706BA)
检查了本知识库文章中描述的所有步骤,远程计算机上的一切正常.
用户是远程计算机上的管理员.
尝试过Wbemtest工具,结果相同
有谁知道发生了什么?
谢谢你,
Vasyl
有没有办法在.Net(C#)中获取远程机器的操作系统版本?使用WMI对我来说是不可接受的.
我有远程机器的IP地址:)和管理员凭据