Use PowerShell to monitor CPU ulitization
You can use this simple command to query CPU utilization of local/remote machine with PowerShell. This is really useful for troubleshooting issues. Enjoy…
Get-Counter -ComputerName “RemotePCName” ‘Processor(*)% Processor Time’ -Continuous -SampleInterval 5
This queries remote computer CPU usage for every 5 seconds continously.
If you want to query the local computer CPU utilization, simply use below command.
Get-Counter ‘Processor(*)% Processor Time’ -Continuos -SampleInterval 5
Hope you liked it.
Categories: PowerShell
CPU utilization using powershell
Hi Techibee,
Thank you for your script. But
I have a problem while implementing this script, let me know how to start:
I want to get an alert if CPU usage is over 85% and stay for more then 2 min continuous then alert via email. Pl send me some power shell script for this issue.
Thanks
AKP
AKP, http://techibee.com/powershell/get-cpu-utilization-of-a-computer-using-powershell/996 answers your question.
Hello,
This is a lovely little script, but how can I return the statistics for the individual processes that are consuming the CPU resources? It is great to know that the overall CPU usage is 95% but to know that SQL server is using 85% of that would be really helpful for troubleshooting.
I know this is an old thread but can you help out here?
Thanks
Rob
no worky…
@gerby, I see that you commented on two posts in this blog saying the solution is “not working”. That is very generic statement and I request you to post the exact error message you are seeing. That helps me to comment better.