PowerShell script exchange
Post Reply
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Editing replica jobs

Post by marius roma »

I have many replica jobs to update.
The fields I need to update are:
- source (backup repository - select all)
- repository for replica metadata
Is there any sample I can start from?
Regards
marius
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Editing replica jobs

Post by PTide » 1 person likes this post

Hi,

Here is an article (another one for v9) with a couple of examples, worth taking a look.

Thank you.
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Editing replica jobs

Post by marius roma »

Thank you for your message.
I am still confused.
I need to configure my replica job to use a backup as its source and I attempted to build a job based on the sapmle you provided, but it does not work:

Code: Select all

Asnp VeeamPSSnapin
$job = Get-VBRJob -Name "MyReplica"
$repository = $repository = Get-VBRBackupRepository -Name "MyBackup"
Set-VBRViReplicaJob -Job $job -Replicatefrombackup -Sourcerepository $repository
I need to set the repository as well for replica metadata.
Can anybody please help?
Regards
marius
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Editing replica jobs

Post by veremin » 1 person likes this post

One $Repository variable appears to be unnecessary.

I've just checked the following script and everything seems to have worked properly:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your replication job"
$SourceRepository = Get-VBRBackupRepository -Name "Name of your source repository"
$MetaRepository = Get-VBRBackupRepository -Name "Name of your repository to store metadata"
Set-VBRViReplicaJob -Job $Job -ReplicateFromBackup -SourceRepository $SourceRepository -BackupRepository $MetaRepository
Thanks.
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Editing replica jobs

Post by marius roma »

Thank you for the useful sample.
It works fine and it solves my issue.
Let me just ask for a further information: is it normal getting a detailed list ot all the job's properties after issuing the Set-VBRViReplicaJob command?
Can I suppress it?
Regards
marius
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Editing replica jobs

Post by veremin » 1 person likes this post

is it normal getting a detailed list ot all the job's properties after issuing the Set-VBRViReplicaJob command?
Correct, most of PS cmdlets return a modified object.
Can I suppress it?
Yes, by using Out-Null cmdlet.

Code: Select all

Set-VBRViReplicaJob -Job $Job -ReplicateFromBackup -SourceRepository $SourceRepository -BackupRepository $MetaRepository | Out-Null
Thanks.
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Editing replica jobs

Post by marius roma »

Just to let you know that we used the code and everything is ok.
Many thanks
Marius
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Editing replica jobs

Post by veremin » 1 person likes this post

As always, we're happy to help. Glad to hear that we were able to answer your requirements. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests