Hi all,
Though I would post this as I was unable to find another way to do it, basically it’s a powershell script to email you the log of your last Scheduled FSA archive. I run this a couple of hours after the scheduled archive.
It’s a little raw but the frame work is all there, please feel free to critique.
########################
### ###
###sendlastnightslog.ps1###
### ###
########################
#Find and get the last log
$archivedir = 'C:\Program Files (x86)\Enterprise Vault\Reports\FSA\File System Archiving Task\ArchiveScheduled\Completed'
$lastdir = dir $archivedir | sort -Property LastWriteTime | select -Last 1
$currentdir = $archivedir + "\" + $lastdir.name
$todaysfile = dir $currentdir
$file = $currentdir + "\" + $todaysfile.Name
#send it to me as a email
$smtpServer = "smtpServe.someplace.com"
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($file)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "dev_ev@someplace.com"
$msg.To.Add("user1@someplace.com")
$msg.To.Add("user2@someplace.com")
$msg.Subject = "DEV - Daily EV Archive log"
$msg.Body = "Please check attached file for errors"
$msg.Attachments.Add($att)
$smtp.Send($msg)
$att.Dispose()
$archivedir = ""
$lastdir = ""
$currentdir = ""
$todaysfile = ""
$file = ""