Skript, mis leiab application log'ist viimase nädala joosul tehtud "Error" tüüpi kirjed ja edastab need administraatorile e-kirjana Powershell: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Created page with '$emailFrom = "user@yourdomain.com" $emailTo = "kaspar.prei@gmail.com" $subject = "error logid" $body = Get-EventLog -logname application -EntryType error -newest 25 $smtpServer =…' |
No edit summary |
||
Line 1: | Line 1: | ||
<source lang="powershell"> | |||
$emailFrom = "user@yourdomain.com" | $emailFrom = "user@yourdomain.com" | ||
$emailTo = "kaspar.prei@gmail.com" | $emailTo = "kaspar.prei@gmail.com" |
Revision as of 23:21, 31 January 2011
<source lang="powershell"> $emailFrom = "user@yourdomain.com" $emailTo = "kaspar.prei@gmail.com" $subject = "error logid" $body = Get-EventLog -logname application -EntryType error -newest 25 $smtpServer = "mail.starman.ee" $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($emailFrom, $emailTo, $subject, $body)