Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Event = Get-eventlog -log application -Newest 1 -source "Windows Backup"
- $Status= $Event.Message
- $From = "email@email.com"
- $To = "email@email.com"
- $SMTPServer = "smtp"
- $SMTPPort = "port"
- $Username = "email"
- $Password = "***"
- $Subject = "$computer, $status"
- $Body = $event | format-list | out-string
- $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
- $smtp.EnableSSL = $false
- $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
- $smtp.Send($From, $To, $subject, $body);
- $computer = "$env:computername"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement