1. Puts the vault store in backup mode
2. puts the index locations in backup mode
3. adds the Veeam ps snapin
4. starts the Veeam backup job
My problem is that when the script gets to the last step to start the job I am getting an error, Start-VBRJob : Exception has been thrown by the target of an invocation.
The backup will start if I add -fullbackup to the command but I don't want to get a full backup everyday for obvious reasons.
Here is the code that I have as of now that works up until the start-vbrjob piece.
Code: Select all
#EV-VEEAM Pre-job
#Create new session to EV Server
$EVSession = New-PSSession -ComputerName Coleman.encorefbo.com -ConfigurationName Microsoft.Powershell32
#Load snapin and please Vault in backup mode
Invoke-Command -Session $EVSession -ScriptBlock {Add-PSSnapin Symantec.EnterpriseVault.PowerShell.Snapin}
Invoke-Command -Session $EVSession -ScriptBlock {Set-vaultstorebackupmode -name "VSG1" -evservername evserver1.encorefbo.com -evobjecttype vaultstoregroup}
Invoke-Command -Session $EVSession -ScriptBlock {set-indexlocationbackupmode -evservername evserver1.encorefbo.com}
invoke-command -Session $EVSession -ScriptBlock {Remove-Item "M:\Enterprise Vault Stores\VS1 Ptn1\ignorearchivebittrigger.old"}
#Clean up session
Remove-PSSession -ComputerName Coleman.encorefbo.com
#Load veeam snapin
add-pssnapin veeampssnapin
#Start Veeam BackupJob
get-vbrjob | where {$_.name -eq "Vault"} | start-vbrjob -FullBackup
Code: Select all
PS C:\Users\zschaffneradmin> get-vbrjob -name "Vault" | Start-VBRJob
Start-VBRJob : Exception has been thrown by the target of an invocation.
At line:1 char:28
+ get-vbrjob -name "Vault" | Start-VBRJob
+ ~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Start-VBRJob], TargetInvocationException
+ FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Veeam.Backup.PowerShell.Command.StartVBRJob