$MonitorTargetObjects= $mg.GetMonitoringObjects($Monitor.Target.GetElement())
$MonitorTargetObjects | Foreach-Object {
$Monitors=new-object System.Collections.Generic.List[Microsoft.EnterpriseManagement.Configuration.ManagementPackMonitor]
$Monitors.Add($Monitor)
$States=$_.GetMonitoringStates($Monitors)
$States |Foreach-Object{ $_.GetMonitoringStateChangeEvents() }
}
关注我的新浪微博:http://weibo.com/haitch ,SystemCenter中文社区:http://wicresoft.azurewebsites.net