PowerShell script exchange
Post Reply
MarcinS
Enthusiast
Posts: 29
Liked: 2 times
Joined: May 18, 2015 8:31 am
Contact:

copy/clone/or...

Post by MarcinS »

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: copy/clone/or...

Post by veremin »

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.
MarcinS
Enthusiast
Posts: 29
Liked: 2 times
Joined: May 18, 2015 8:31 am
Contact:

Re: copy/clone/or...

Post by MarcinS »

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 :(
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: copy/clone/or...

Post by veremin »

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.
MarcinS
Enthusiast
Posts: 29
Liked: 2 times
Joined: May 18, 2015 8:31 am
Contact:

Re: copy/clone/or...

Post by MarcinS » 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 :)
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: copy/clone/or...

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests