$ComputerMemory = Get-WmiObject -ComputerName $Server -Class win32_operatingsystem -ErrorAction Stop $Processor = (Get-WmiObject -ComputerName $Server -Class win32_processor -ErrorAction Stop | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average Script is based on Get-WmiObject commands: This is why the following script has been created to avoid similar cases in the future and to quickly identify culprit. Unfortunately SCOM server didn’t catch that CPU or Memory sudden spike and I had to scan all of our servers manually to find what is happening. In past I often had this situation when one of the servers was unresponsive due to high performance which was causing service interruption. This is another great example on how to use PowerShell custom objects and add it to array. If you would like to quickly display CPU and Memory utilization in PowerShell console then this script is for you.
0 Comments
Leave a Reply. |