I'm in the middle of fixing up a script to fully chase the vCentre around the cluster and back it up (the not quite supported "edit the SQL database" version does work - but I'm trying to find a method using supported tools). I will publish it here when done. Although the job works, I have one last problem...
The method I am using is to remove the VM from the job, and then add it back in, however on doing so 1 option that is set on the job gets reset and Set-VBRJobOptions does not appear to play ball.
The relevant part of the script does this:
#get the job options
$Options = Get-VBRJobOptions $Job
#and force the transaction log trunction to be never (as preferred)
$Job.vssoptions.TransactionLogsTruncation = "Never"
Set-VBRJobOptions -job $Job -options $Options
The logic is
* get the options for the job as it has been created.
* make any required changes to the job options
* then modify with (in this case) one of the permitted values ("Never, OnlyOnSuccessJob, Always")
* write it back,
The script works without error (and changing away from an allowed value for the Truncation does generate an error - so I know the code is OK), but the backup job in VBR remains unchanged. Any idea what have I done wrong? Or is this a bug in the cmdlet?
Any suggestions gratefully received.