Obtener todas las Alarmas activadas y sus estados en vSphere

Aquí les traigo un script para que puedan obtener todas las alarmas activadas con sus estados y si estas están Acknowledged o no.

Add-PSSnapin VMware.VimAutomation.Core
connect-viserver -server VC50LAB.QE.LOCAL -user qe\tester -password Control123567 -port 443
$SI = Get-View ServiceInstance
$AM = Get-View $SI.Content.AlarmManager
ForEach ($Folder in (Get-Folder -NoRecursion))
{
   #$Folder
   ForEach ($Alarm in ($Folder|Get-View).TriggeredAlarmState)
  {
    $alarmDef = Get-View -Id $Alarm.Alarm
    ($alarmDef.Info.Name + ": " + $Alarm.OverallStatus)
   ("Acknowledged: " + $Alarm.Acknowledged)
 }
}

Disconnect-viserver -Server VC50LAB.QE.LOCAL -Confirm:$false
Remove-PSSnapin VMware.VimAutomation.Core



Como resultado obtendrán 
PowerCLI C:\PS1> .\GetAllTriggeredAlarmsWithStatus.ps1

Name                           Port  User
----                           ----  ----
VC50LAB.QE.LOCAL    443    qe\tester
Alarm's Temporary Warning Alarm: yellow
Acknowledged: False
Diego's Temporary Warning Alarm: yellow
Acknowledged: False
Datastore is in multiple datacenters: red
Acknowledged: False
Datastore is in multiple datacenters: red
Acknowledged: False

Comentarios