SOLVED

Get-Counter: Could not find any performance counter sets on the 192.168.50.101 computer: error 80000

Copper Contributor

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.

 

 

 

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-counter?vie... 

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.

gongyan_0-1683111875266.png

The Still Image Acquisition Events service terminated due to the following service-specific error:
The RPC server is unavailable.

gongyan_1-1683111966260.png

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.

 

 

 

 

 

 

 

 

2 Replies
best response confirmed by gongyan (Copper Contributor)
Solution

@gongyan 

 

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.

 

LainRobertson_0-1683191997731.png

 

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.

 

LainRobertson_1-1683192241273.png

 

Cheers,

Lain

Yes, exactly as you might expect. It is because port 445 of the firewall on the virtual machine is not released. At the same time, I also encountered the c0000bdb error you mentioned.
I was confused at first because the get-counter command doesn't have parameters to pass username and password. Finally, I suddenly realized that I opened Windows Explorer, entered "\\virtual machine IP address" in the address bar, then entered the corresponding account password, and selected "Save Credentials", and then I ran the command again, this time it was successful!

Finally, you are so awesome, very professional and enthusiastic, thank you very much, I wish you all the best in your work and life.