Scripts Thread, Powershell script pulling processor time errors out in Coding and Web Development; So I'm running the following powershell script to monitor processor useage over a five minute interval on multiple servers, and ...
25th July 2012, 02:43 AM #1
- Rep Power
Powershell script pulling processor time errors out
So I'm running the following powershell script to monitor processor useage over a five minute interval on multiple servers, and on one of them I get one to four samples before it errors out with the error below.
Get-Counter -Counter “\Processor(_Total)\% Processor Time” -SampleInterval 1 -MaxSamples 300 | Select -ExpandProperty CounterSamples | Select CookedValue | Out-File -Append $loglocation\results-$name-$date.csv
This is occurring on the only 2k8 R2 server in the group being monitored, the script runs fine on 2k3, 2k3 R2, and 2k8 servers. The processor is a Xeon E31230 3.2 GHz. Anyone have any thoughts on why this might be occuring?
Get-Counter : A counter with a negative denominator value was detected. At line:1 char:12
+ get-counter <<<< -counter "\Processor(_Total)\% Processor Time" -sampleinterval 1 -maxsamples 100 | select -expandproperty countersamples | select cookedvalue | Out-File -Append $loglocation\results-$name-$date.csv
+ CategoryInfo : InvalidResult: (
+ FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.GetC ounterCommand
By djameson in forum Scripts
Last Post: 30th August 2011, 01:01 PM
Last Post: 31st January 2008, 01:17 PM
By fawkers in forum Scripts
Last Post: 24th January 2008, 03:58 PM
By randle in forum Windows
Last Post: 22nd May 2007, 01:46 PM
By shill31 in forum Educational Software
Last Post: 22nd May 2007, 11:09 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)