I am writing a script that, among collecting other performance counters, will find all the physical network adapters on the machine running it and gets those adapters' Bytes Sent and Bytes Received counters.
I understand that to get such counters, the following command works nicely:
Get-Counter "\Network Interface(<unique id>)\Bytes Received/sec"
My problem is this "unique id". For instance, when I list the "PathsWithInstances" of the Network Interface class, one of the id's in one of the paths is:
Intel[R] 82574L Gigabit Network Connection _2
However when I find this same adapter with the following command:
Get-WmiObject win32_networkadapterconfiguration -Filter 'ipenabled = "true"'
It has the Description :
Intel(R) 82574L Gigabit Network Connection #2
You'll notice that the id and description are similar but not identical, keeping me from using the NetworkAdapterConfiguration object to get it's data sent\received from get-counter
I guess all I'm really asking is how to get data sent/received from a specific network adapter using a reference to that Network adapter or network adapter configuration.