PowerCLI

 Exporting notification recipients

Paul Jadlowski's profile image
Paul Jadlowski posted Jan 27, 2025 04:34 PM

Hello!

I recently have discovered that some of the Vcenter notifications are going to an old mailbox that doesn't exist.

I cannot seem to figure a way to export where all of these are configured and to who they are going to, as there have been many people over the years making changes, I am sure. 

The only solution I have found was to click on each, one by one, and see how they are configured.  That would take forever as there are a lot of different things we can be notified about.

Can PowerCLI pull this information?  I have be researching it, but can't seem to pin it down,

Alternatively, if there a freeware or open source way of getting this information, I can go that route.

Thanks, in advance, for any time spent on assisting me with this!

LucD's profile image
LucD

Are you talking about notifications coming from vCenter Alarms?

Paul Jadlowski's profile image
Paul Jadlowski

Yes, the alarms for VCenter.  What started this was I saw this entry:

Alarm 'Datastore usage on disk' on DATA_01 sent email to ExEmployee@nch.com

I am trying to find out other alarms are being sent out to this or even other old e-mail addresses.

Thank you for the assist!

LucD's profile image
LucD

Try something like this

Get-AlarmDefinition |
Get-AlarmAction -ActionType SendEmail |
ForEach-Object -Process {
  New-Object -TypeName PSObject -Property ([ordered]@{
    Alarm = $_.AlarmDefinition.Name
    To = $_.To -join '|'
  })
} | Export-Csv -Path .\email.csv -NoTypeInformation -UseCulture