Quantcast
Channel: Backup – Windows and Windows Server forum
Viewing all articles
Browse latest Browse all 1854

Specify location of backup log when doing powershell backup

$
0
0

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. 


Viewing all articles
Browse latest Browse all 1854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>