Posts

Showing posts from August, 2017

SCOM Powershell script to fetch Monitors with thresholds

Please find the SCOM Powershell script to fetch Monitors with thresholds function GetThreshold ([String] $configuration) { $config = [xml] ("<config>" + $configuration + "</config>") $threshold = $config.Config.Threshold if($threshold -eq $null) { $threshold = $config.Config.MemoryThreshold } if($threshold -eq $null) { $threshold = $config.Config.CPUPercentageThreshold } if($threshold -eq $null) { if($config.Config.Threshold1 -ne $null -and $config.Config.Threshold2 -ne $null) { $threshold = "first threshold is: " + $config.Config.Threshold1 + " second threshold is: " + $config.Config.Threshold2 } } if($threshold -eq $null) { if($config.Config.ThresholdWarnSec -ne $null -and $config.Config.ThresholdErrorSec -ne $null) { $threshold = "warning threshold is: " + $config.Config.ThresholdWarnSec + " error threshold is: " + $config.Config.ThresholdErrorSec } } if(