I am backing up a Windows Server 2008 R2 computer with the following commands:
Add-PsSnapin Windows.ServerBackup
$lcBackupPath = "\\mybackupserver\mybackuppath"
$policy=New-WBPolicy
$ListOfFileSpecs=New-WBFileSpec -FileSpec c:\
Add-WBFileSpec -Policy $policy -FileSpec $ListOfFileSpecs
$BackupTargetVolume=New-WBBackupTarget -NetworkPath $lcBackupPath
Add-WBBackupTarget -Policy $policy -Target $BackupTargetVolume
Add-WBSystemState -Policy $policy
Add-WBBareMetalRecovery -Policy $policy
Start-WBBackup -Policy $policy
I need to email a log of whether or not the backup was successful.
I can get the result of the most previous backup like this:
get-wbjob -previous 1
The only useful information I get from this is jobstate="Job Completed", start time, end time, jobitems, and versionid
It contains two additional blank items called SuccessLogPath and FailureLogPath
how do I set the SuccessLogPath and FailureLogPath for the backup?
I need to know if the job was successful or failed.