Share via


How to get average CPU Utilization per day using powershell ?

Question

Thursday, December 11, 2014 3:00 PM

Hello,

I have ran following command to get CPU Utilization :

Get-WmiObject -Class Win32_Processor -ComputerName "MyServer" | Select SystemName , DeviceID , LoadPercentage , Status

However, output is captured during the time when command is getting executed.

By any chance is it possible to capture the Average CPU Utilization for previous day to monitor performance ?

Thanks and Regards,

Dipti Chhatrapati

All replies (6)

Thursday, December 11, 2014 3:08 PM ✅Answered

Hello Dipti Chhatrapati,

Use the following command:

Get-WmiObject -computer server -class win32_processor | Measure-Object -property LoadPercentage -Average | Select-Object -ExpandProperty Average

[1] http://stackoverflow.com/questions/21706117/how-to-determine-the-average-cpu-percentage-using-a-powershell-command-and-outpu

Regards,
Hristo Valev
Developer-Hotline for MSDN Online Germany

Disclaimer:
Please take into consideration, that further inquiries cannot or will be answered with delay.
For further information please contact us per telephone through the MSDN-Entwickler-Hotline: http://www.msdn-online.de/Hotline

For this post by the MSDN-Entwickler-Hotline the following terms and conditions apply: Trademarks, Privacy as well as the separate terms of use for the MSDN-Entwickler-Hotline.


Thursday, December 11, 2014 3:17 PM ✅Answered

Historical monitoring would be better utilized with Performance Monitor.

I would suggest reading through: http://technet.microsoft.com/en-us/library/cc749115.aspx


Friday, December 12, 2014 9:20 AM ✅Answered

Hi,

According to your post, my understanding is that you want to get the average CPU utilization using PowerShell.

For average CPU usage, we can use the PowerShell as below.

Get-WmiObject win32_processor | Measure-Object -property LoadPercentage -Average | Select Average

http://stackoverflow.com/questions/6298941/how-do-i-find-the-cpu-and-ram-usage-using-powershell

As this is the forum for SharePoint server on-premise, for this issue, I recommend you can post a new question in the forum for Windows PowerShell.

https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell

More experts will assist you, then you will get more information relation to Windows PowerShell.

Thank you for your understanding and support.

Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected].

Jason Guo
TechNet Community Support


Friday, December 12, 2014 10:32 AM

Hi All,

I am still confused about the suggested command.

I have ran following command by time 3:54 PM :

Get-WmiObject -Class Win32_Processor | Select SystemName , DeviceID , LoadPercentage , Status

And I received following output :

Meaning , this load percentage is only captured by time 3:54 PM.however , if some other time load percentage has got increased by any reason in same day , I couldn't be aware for the same.And hence I want to know the average CPU load percentage of the previous day from 12/12/2014 00:00:00 to 12/12/2014 24:00:00.

I have ran following command as you suggested by 3:58 PM :

Get-WmiObject win32_processor | Measure-Object -property LoadPercentage -Average | Select Average

And I received following output :

What this average means ? average of load percentage of all CPUs by time 3:58 ?? If yes, then my question is still open as I require load percentage of each CPU by considering entire day.

I hope I am clearing the question.Please let me know if any concern/question.

Thanks and Regards,

Dipti Chhatrapati


Friday, December 12, 2014 2:24 PM

Again, historical monitoring of windows services through WMI would best be served through Performance Monitor.

Or a system monitor such as Nagios+ or a related setup ( which may require additional cost to implement. )


Thursday, August 4, 2016 5:26 AM

Load Percentage is not Load average of per day.

Load Percentage is Load capacity of each processor, averaged to the last second. Processor loading refers to the total computing burden for each processor at one time.