scripts alert event

https://clusteringformeremortals.com/2018/10/28/step-by-step-how-to-trigger-an-email-alert-from-a-windows-event-that-includes-the-event-details-using-windows-server-2016/

Get-WinEvent -LogName Microsoft-Windows-PowerShell/Operational | Where-Object {$_.ID -eq « 4100 » -or $_.ID -eq « 4104 »}

creation event log test
# New-EventLog –LogName Application –Source « Test »
# Write-EventLog –LogName Application –Source « Test » –EntryType Error –EventID 1 –Message « This is a test message. »

exemple
send alert error by event application / log test
https://www.ryadel.com/en/event-viewer-send-notification-e-mail-messages-with-powershell/

https://github.com/blachniet/blachniet-psutils/blob/master/Send-EventEntryEmail.psm1

 —————————————–
https://chinnychukwudozie.com/2014/11/12/powershell-script-monitors-security-logs-and-sends-email-alerts/

https://www.red-gate.com/simple-talk/sysadmin/powershell/powershell-day-to-day-sysadmin-tasks-events-and-monitoring/