Otherwise, if you’re willing to copy job from remote VB&R server, you need firstly to connect to remote
PowerShell instance, using invoke-command, or whatever, then collect everything you want to.
The following example will give a little more understanding how this process should be scripted:
Code: Select all
#First part (Remote)
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of the job you're willing to copy"
$Names = ($Job | Get-VBRJobObject).name
$Options = $Job.GetOptions()
$VSSOptions = $Job.GetVssOptions()
#Second part (Local)
Asnp VeeamPSSnapin
$Server = Get-VBRServer | ?{($_.type -eq "vc") -and (($_.name -eq "Name of your VC") )}
$Entity = foreach ($name in $Names)
{
Find-VBRViEntity -Server $Server | ? {($_.name -eq $Name)}
}
$Repository = Get-VBRBackupRepository -name "Name of your repository"
Add-VBRViBackupJob -Entity $Entity -Name "Name of the job you're willing to create" -BackupRepository $Repository
Start-sleep -s 5
$Job2 = Get-VBRJob | ? {$_.name -eq "Name of the job you're willing to create"}
$Job2.SetOptions($Options)
$Job2.SetVssOptions($VSSOptions)
First part of the abovementioned script is responsible for collecting job settings and should be executed on remote machine; second part will create a new job on your local machine and pass previously collected settings to it.
Please be aware that manual input is only required if in the settings of the job which you’re willing to copy there is a particular proxy server specified; it won’t be copied and you will need to set proxy server afterwards.
Hope this helps.
Thanks.