May 03 2023 02:05 AM - edited May 03 2023 04:08 AM
I use hyper-v to virtualize a Windows Server 2016 on my Windows 10. I ensured that the network between the host machine and the virtual machine is unblocked, as follows:
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>
But when I use command like below, it returns error:
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.
According to the introduction, it can be used without configuring remote commands. I don't know why this error occurs, and there are almost no relevant instructions on the Internet.
Tried restarting the virtual machine, but that didn't solve the problem. Please take a look, thank you very much.
I think, I probably know why, because the WiaRpc service did not start successfully. Found this thanks to this code sample.
Writing Performance Data to a Log File
But a new problem appeared: I couldn't start the WiaRpc service, I tried many methods.
[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 could not start still image Acquisition Events on Local Computer. Consult the system event log for more information. If this is a non-Microsott service, please contact your service vendor and refer to Service Specific Error Code 1722.
The Still Image Acquisition Events service terminated due to the following service-specific error:
The RPC server is unavailable.
But in fact, the rpc service is running.
PS C:\Users\Administrator> Get-Service -Name "*rpc*"
Status Name DisplayName
------ ---- -----------
Running RpcEptMapper RPC Endpoint Mapper
Stopped RpcLocator Remote Procedure Call (RPC) Locator
Running RpcSs Remote Procedure Call (RPC)
Stopped WiaRpc Still Image Acquisition Events
PS C:\Users\Administrator>
Now, there's really nothing I can do.
May 04 2023 02:25 AM
Solution
Your ping test doesn't prove you have connectivity since Get-Counter does not use ICMP.
Get-Counter leverages SMB, which operates over TCP 445.
You've only provided the first part of the error code, but my guess is the full error code is 800007d0. If this is the case, then you have something blocking your ability to reach TCP 445. That could be a firewall on your client, a firewall on the target host, or even a firewall appliance somewhere between the two.
This is a Wireshark trace showing the repeated attempts to connect to TCP 445 during the connection attempt that ultimately fails with error 800007d0.
Once you get past the firewall issue, you still need to have sufficient rights on the target host. If you do not, you will fail with error c0000bdb, for which I've included the Wireshark trace showing the "access denied" error sent from the target host back to the client.
Cheers,
Lain
May 13 2023 02:05 AM