Forum posts for perfmon.exe

Perfmon.exe not showing values for Network Interface via powershell

I've been trying to make powershell make a csv file with certain information in Windows 7's perfmon.exe

Most of it works, but it seems to ignore 3 counters.

The script looks like the following:

$SampleInterval='4'
$MaxSamples='15'
$FileDestinationFolder='C:Perfmon'
$date = (Get-Date).ToShortDateString()
Get-Counter
$gc = ('Network Interface(`*)Current Bandwith',
'Network Interface(`*)Packets Recieved/sec',
'Network Interface(`*)Packets Sent/sec',
'PhysicalDisk(_Total)Disk Write Bytes/sec',
'PhysicalDisk(_Total)Disk Read Bytes/sec',
'Processor(_Total)\% Processor Time',
'Processor(_Total)\% Idle Time',
'Memory\% Committed Bytes In Use',
'MemoryAvailable MBytes')
Get-Counter -counter $gc -SampleInterval $SampleInterval -MaxSamples $MaxSamples | export-counter -force -path ('$FileDestinationFolderPerfMon-$date.csv') -FileFormat csv


I do get stats for PhysicalDisk, Processor and Memory, but none of the Network Interfaces. The path for Network Interface is fetched from the Data Collector itself.
Any clue why this may be so?

EDIT --
If I read them in alone, I can see that it prints all the network interfaces in the Powershell ISE, but doesn't write the content to the csv file.

Example on output is


Timestamp CounterSamples
--------- --------------
06-12-2012 15:13:30 dkspare03 etwork interface(intel[r] 82577lm gigabi
t network connection)ytes total/sec :
27101,2080498825


\dkspare03 etwork interface(intel[r] centrino[r] ad
vanced-n 6200 agn)ytes total/sec :
0


Currently, Network Interface has an escape character where it tells what NIC to read.
In case I do not have it, powershell enlist an error as following:


Get-Counter : Internal performance counter API call failed. Error: c0000bb9.
At line:38 char:12
+ Get-Counter <<<< -counter $gc -SampleInterval $SampleInterval -MaxSamples $M
axSamples | export-counter -force -path ('$FileDestinationFolderPerfMon-$date.
csv') -FileFormat csv
+ CategoryInfo : InvalidResult: (:) [Get-Counter], Exception
+ FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.Ge
tCounterCommand

View complete forum thread with replies

Other posts related to perfmon.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Meaning of WCF counters in perfmon.exe
ASP.NET &ldquo;Sessions Timed Out&rdquo; Counter (perfmon.exe)
Perfmon.exe not showing values for Network Interface via powershell
Is there any small,flexible and better perfomance monitor tools than &ldquo;perfmon.exe&rdquo; in window&hellip;
Manipulate the Performance Monitor Programmatically

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.