0

How can I get a list of all WMI performance counters classes on a given server, to use in scripts for monitoring purposes.

I know one can use the performance monitor, but the classes displayed don't match the name of those available via WMI PerfFormattedData classes.

The Get-Counters offer some advantages over the Get-CimInstance commandlet, such as passing an array of counters, but the returned counters are not script friendly.

Thomas B in BDX
  • 147
  • 1
  • 1
  • 10

1 Answers1

1

Using powershell is pretty easy and quick with that command:

Get-WmiObject Win32_PerfFormattedData  | Select-Object __CLASS | Sort-Object -Unique -Property __CLASS | format-list

Or Redirect to a file:

Get-WmiObject Win32_PerfFormattedData  | Select-Object __CLASS | Sort-Object -Unique -Property __CLASS | format-list *> .\Win32_PerfFormattedData_class_list.txt

and then one can discover the fields of an individual class:

PS C:\Users\user1> Get-CimInstance Win32_PerfFormattedData_PerfOS_Memory

AvailableBytes                       : 6186450944
AvailableKBytes                      : 6041456
AvailableMBytes                      : 5899
CacheBytes                           : 426688512
CacheBytesPeak                       : 1207418880
CacheFaultsPersec                    : 3
CommitLimit                          : 157792387072
CommittedBytes                       : 135447302144
DemandZeroFaultsPersec               : 305
FreeAndZeroPageListBytes             : 3529670656
FreeSystemPageTableEntries           : 16423182
Thomas B in BDX
  • 147
  • 1
  • 1
  • 10