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/