Editing replica jobs

PowerShell script exchange

Editing replica jobs

Veeam Logoby marius roma » Tue Nov 29, 2016 10:10 am

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
marius roma
Expert
 
Posts: 332
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Editing replica jobs

Veeam Logoby PTide » Tue Nov 29, 2016 4:53 pm 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.
PTide
Veeam Software
 
Posts: 3249
Liked: 272 times
Joined: Tue May 19, 2015 1:46 pm

Re: Editing replica jobs

Veeam Logoby marius roma » Wed Nov 30, 2016 1:44 pm

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
marius roma
Expert
 
Posts: 332
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Editing replica jobs

Veeam Logoby v.Eremin » Wed Nov 30, 2016 2:33 pm 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.
v.Eremin
Veeam Software
 
Posts: 13734
Liked: 1027 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Editing replica jobs

Veeam Logoby marius roma » Wed Nov 30, 2016 3:17 pm

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
marius roma
Expert
 
Posts: 332
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Editing replica jobs

Veeam Logoby v.Eremin » Wed Nov 30, 2016 4:17 pm 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.
v.Eremin
Veeam Software
 
Posts: 13734
Liked: 1027 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Editing replica jobs

Veeam Logoby marius roma » Tue Dec 06, 2016 2:53 pm

Just to let you know that we used the code and everything is ok.
Many thanks
Marius
marius roma
Expert
 
Posts: 332
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

Re: Editing replica jobs

Veeam Logoby v.Eremin » Fri Dec 09, 2016 2:46 pm 1 person likes this post

As always, we're happy to help. Glad to hear that we were able to answer your requirements. Thanks.
v.Eremin
Veeam Software
 
Posts: 13734
Liked: 1027 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest