Using Performance Monitor counter IDs instead of the counter names

Mikhail Firsov 1,881 Reputation points
2020-07-30T11:39:18.67+00:00

Hello,

As you already may know each Performance Monitor counter has the corresponding ID which you can find in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter

So theoretically we can get the counter value by typing

Get-Counter -Counter "\2\10" instead of

Get-Counter -Counter "\System\File Read Operations/sec" - and it does work:

14546-1.png

But I don't understand why other counters may not be read by such method:

Get-Counter -Counter "\System\File Read Operations/sec"

14651-2.png

What;s wrong with the second query?

Thank you in advance,
Michael

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. TimCerling(ret) 1,156 Reputation points
    2020-07-30T13:11:48.317+00:00

    You may want to ask the scripting experts over in their forum - https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG

    Or post to the new location at https://learn.microsoft.com/en-us/answers/topics/windows-server-powershell.html

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Mikhail Firsov 1,881 Reputation points
    2020-07-30T13:22:04.287+00:00

    Here's one more example:
    14681-3-1.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.