Reply To: Email Event viewer logs from servers

Home Forums Scripting PowerShell Email Event viewer logs from servers Reply To: Email Event viewer logs from servers

Avatar
todd231
Participant
#614307

disregard guys, I got it…

 

Get-Eventlog -log application -after ((get-date).addDays(-1)) -EntryType Error, Warning | export-csv “C:\transfer\appevents.csv”

Send-MailMessage -To [email protected]-From “[email protected]” -Subject “Application Events” -Attachments “c:\transfer\appevents.csv” -SmtpServer smtp.mydomain.com

 

This works much, much better!