我使用 hyper-v 在我的 Windows 2016 上虚拟化 Windows Server 10。我确保主机和虚拟机之间的网络畅通无阻,如下所示:
PS 2023年5月3日 16:44:41 C:\Users\gyj> $server_ip
192.168.50.101
PS 2023年5月3日 16:54:47 C:\Users\gyj> ping $server_ip
正在 Ping 192.168.50.101 具有 32 字节的数据:
来自 192.168.50.101 的回复: 字节=32 时间<1ms TTL=128
来自 192.168.50.101 的回复: 字节=32 时间<1ms TTL=128
来自 192.168.50.101 的回复: 字节=32 时间<1ms TTL=128
来自 192.168.50.101 的回复: 字节=32 时间<1ms TTL=128
192.168.50.101 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
PS 2023年5月3日 16:55:01 C:\Users\gyj>
但是当我使用如下所示的命令时,它会返回错误:
PS 2023年5月3日 16:22:17 C:\Users\gyj> Get-Counter -ListSet * -ComputerName $server_ip
Get-Counter: Could not find any performance counter sets on the 192.168.50.101 computer: error 800007d0. Verify that the 192.168.50.101 computer exists, that it is discoverable, and that you have sufficient privileges to view performance counter data on that computer.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-counter?vie...
根据介绍,无需配置远程命令即可使用。我不知道为什么会出现这个错误,网上几乎没有相关的说明。
已尝试重新启动虚拟机,但这并不能解决问题。请看一看,非常感谢。
我想,我可能知道为什么,因为WiaRpc服务没有成功启动。这要归功于此代码示例。
将性能数据写入日志文件
但是出现了一个新问题:我无法启动WiaRpc服务,我尝试了很多方法。
[Windows Server 2016]: PS C:\Users\Administrator\Documents> Get-Service "WiaRpc"|Start-Service
Start-Service : 无法启动服务“Still Image Acquisition Events (WiaRpc)”。
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
[Windows Server 2016]: PS C:\Users\Administrator\Documents>
Windows 无法启动本地计算机上的静止图像采集事件。有关详细信息,请参阅系统事件日志。如果这是非 Microsott 服务,请联系您的服务供应商并参考服务特定错误代码 1722。

静止图像采集事件服务由于以下特定于服务的错误而终止:
RPC 服务器不可用。

但实际上,rpc 服务正在运行。
PS C:\Users\Administrator> Get-Service -Name "*rpc*"
Status Name DisplayName
现在,我真的无能为力。