AEM CentraStage Event Result Script

Hi, 

We are using AEM CentraStage Monitoring as an monitoring tool. With this monitoring program we are trying to create e-mail notifications of the event log. 

To create the e-mail notifications we need to create an custom component. For the custom component we have written the following PowerShell script:

$Event = Get-WinEvent -FilterHashtable @{logname='Microsoft-Windows-Backup'; id=4,5,8,9,19,49;StartTime=(Get-Date).AddMinutes(-2015)} -MaxEvents 1 -ErrorAction SilentlyContinue | format-list

If ($Event -eq $null)
	{ Exit 0 } #No events logged
Else
{ 
Write-Host "<-Start Result->"
Write-Host "Result="($Event | Format-Table | Out-String)
Write-Host "<-End Result->"
Exit 1
}

But when we receive an e-mail notificiaton, the e-mail is empty
Like this: 

I have tried different variation in the script like removing the  format-list Command, but then we receive an e-mail notification with errors.

Like this


Can somebody help me out, Because i don't have enoug knowledge to resolve this problem on my own. 

Kind regard,
Francois Meulenberg


  • Edited by Francois013 Tuesday, September 01, 2015 8:42 AM wrong names
September 1st, 2015 8:40am

Hi,

Thank you for your reply, 
I Tried it, but we can't get the e-mail notification working.

The new code resolves the output but we stil can't put the output in an e-mail

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 6:16am

You need to post all of your script or you need to post in the vendor forum for you "AEM".
September 14th, 2015 11:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics