copy/clone/or...

PowerShell script exchange

copy/clone/or...

Veeam Logoby MarcinS » Thu Sep 15, 2016 11:52 am

Hi Guys,

i have in veeam Job A i want to create Job B which should have exactly the same settings like job A beside to VM(s) its contains. How to do this in/by powershell.

Important is to new job have name "B" not A_cloneXX.

I tried and cloning is easy by powershell but then name have that _cloneXX ...so maybe You know how to change name (and description)

regards
Marcin
MarcinS
Influencer
 
Posts: 21
Liked: 2 times
Joined: Mon May 18, 2015 8:31 am

Re: copy/clone/or...

Veeam Logoby v.Eremin » Thu Sep 15, 2016 12:01 pm

You can create the exact copy of existing job using Copy-VBRJob commandlet. Unfortunately, during that operation you cannot change job name, neither can you modify its description.

So, once all jobs have been cloned, you will need to change those properties manually.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: copy/clone/or...

Veeam Logoby MarcinS » Thu Sep 15, 2016 12:24 pm

Yes i exactly used mentioned command. About change "manually" ...this is problem how to change this (name & description) by script way ...manual is no solution for me :(
MarcinS
Influencer
 
Posts: 21
Liked: 2 times
Joined: Mon May 18, 2015 8:31 am

Re: copy/clone/or...

Veeam Logoby v.Eremin » Thu Sep 15, 2016 1:00 pm

I've found the unsupported way to change job name by loading assembly first. Leverage it on your own risk:

Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -Name "Name of your Job"
$Job.Info.CommonInfo.Name = "New Name "
[Veeam.Backup.Core.CBackupJob]::Update($Job.Info)


The description cannot be modified this way.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: copy/clone/or...

Veeam Logoby MarcinS » Fri Sep 16, 2016 9:17 am 1 person likes this post

ok ..thx it better then nothing :) ....why veeam will not import method to choose name inside cloning process :)

Maybe somone have script which create new job by script (when choosing name is possible) and then copying 1 by 1 all settings from other selected job

i see something like this
create job B
take job A
take all settings
in loop take setting and implement in job B

anyway most funny is fact that mechanism is already in cloning command :)
MarcinS
Influencer
 
Posts: 21
Liked: 2 times
Joined: Mon May 18, 2015 8:31 am

Re: copy/clone/or...

Veeam Logoby v.Eremin » Fri Sep 16, 2016 12:05 pm

why veeam will not import method to choose name inside cloning process :)

PowerShell snap-in emulates GUI functionality, and GUI doesn't allow changing names during clone operation. The request makes sense, though. So, thank you for the feedback.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 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 5 guests