Using the GUI to set up email alerts for the default alarm might be time-consuming. In this post I will show you how to use VMware PowerCLi to automate re-configuring the existing, Default alarms with the notification email address.

You will need VMware PowerCLi to run through this. if you dont have this installed already, follow the instructions found here.

Use The below script to change the enable Default email action to the email address specified in the $newEmail=” field

$newEmail = 'ntitta@ikigo.net'
foreach ($alarm in Get-AlarmDefinition){
    $action = Get-AlarmAction -AlarmDefinition $alarm
    $mail = $action | where {$_.ActionType -eq 'SendEmail'}
	New-AlarmAction -AlarmDefinition $alarm -Email -To $newEmail -Subject $mail.Subject -Confirm:$false
}

Leave a Reply

Your email address will not be published. Required fields are marked *