Skript, mis leiab application log'ist viimase nädala joosul tehtud "Error" tüüpi kirjed ja edastab need administraatorile e-kirjana Powershell

From ICO wiki
Revision as of 23:20, 31 January 2011 by Kprei (talk | contribs) (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 =…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

$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)