Catch me if you can
Catch me if you can
Time to build a new bird houseNo tags for this post.
In 2012 we adopted a beautiful son from foster care. On August 19th 2014 we were chosen to bring his four day old brother home from the hospital. That Friday we were notified that DSS intends to move him to be placed with a not quite two year old sibling who has never met him. They also intend on disrupting the two year old’s placement in order to put them into a completely different home. I was told their goal was to re unify siblings. So it makes no sense to move my son’s baby brother. My child already knows him, understands that this is his brother, and is bonded with him. We will possibly need a lawyer before this is all done. And if we do, we’ll need one quickly. We are trying to raise enough funds to retain legal representation for our son’s brother.
Please share the link or donate either or will help..
Ran into a case that would be nice to receive an email alert based upon a a phrase or error in a log/txt file. Well after I set it up and tested it I decided to do something different but this did work quite well so I thought I’d share.
Remember to execute this with powershell, I used the variable $env:computerName to pull the hostname of the pc. You can just put an email address if you want.
Code starts below the ##
##search error in log
if (Select-String -Path “\\server\d$\Program Files\BackupSoftware\log\server.log” -pattern “Could not open disk”)
Write-Host “Sending Email”
#SMTP server name
$smtpServer = “mail.yourdomain.com”
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = “$env:computerName@yourdomain.com”
$msg.ReplyTo = “$env:computerName@yourdomain.com”
$msg.subject = “Backup Errors”
$msg.body = “Backup failed on $env:ComputerName. Please check the error logs on”
original script was from technet but I don’t have the link.Tags: Microsoft, Powershell, Windows
Repainted hellas and took the sti badge off for now.No tags for this post.
Lord V on the macbook pro.No tags for this post.
IMThePhotogNinja’s photostream on Flickr.
Visit my Flickr PageNo tags for this post.
No tags for this post.
Random flowerNo tags for this post.