I need to find a way to export a list of all alerts that have been set in vCenter. I need to also know where they have been set, IE vCenter, Datacenter, cluster, folders, VMs, etc. In particular I need to know what email address have been set for these alerts to notify.
Core issue is a former employee set some alerts to send emails, well they are gone but the alerts are still trying to notify them so I need to clean these out.
Regards,
Michael
It's easiest to do this with PowerCLI, so you may want to post your question over there, or look around for a script.
Hi,
I propose for you this script. I had enough time to script at Lunch
$Sendis = Get-AlarmAction | where {$_.ActionType -like "SendEmail"} | select @{l="To";e={$_.To -join ","}},ActionType,AlarmDefinition
$Output = New-Object psobject
$Output | Add-Member -MemberType NoteProperty -Name TO -Value $Sendis.To
$Output | Add-Member -MemberType NoteProperty -Name ActionType -Value $Sendis.ActionType
$Output | Add-Member -MemberType NoteProperty -Name AlarmDefinition -Value $Sendis.AlarmDefinition
$Output
Thank you,
Oups, sorry, For all alarm :
$ALLSendis = Get-AlarmAction | where {$_.ActionType -like "SendEmail"} | select @{l="To";e={$_.To -join ","}},ActionType,AlarmDefinition
foreach ($Sendis in $ALLSendis) {
$Output = New-Object psobject
$Output | Add-Member -MemberType NoteProperty -Name TO -Value $Sendis.To
$Output | Add-Member -MemberType NoteProperty -Name ActionType -Value $Sendis.ActionType
$Output | Add-Member -MemberType NoteProperty -Name AlarmDefinition -Value $Sendis.AlarmDefinition
$Output
}