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

Getting information about jobs in order to re-create them

Post by marius roma »

I need to create a script to get information about existing Veeam backup and replica jobs including processed VMs, target folder, options, schedule.
Once collected all the information I need to create a second job to create new jobs with slightly different settings.
Where can I locate samples to start from?
Regards
Marius
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Getting information about jobs in order to re-create the

Post by nielsengelen »

You can clone jobs and afterwards edit them. Maybe this is already an easier & faster option for you?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Getting information about jobs in order to re-create the

Post by marius roma »

Can I clone jobs with the "Standard" license?
Anyway, I don't think it is a solution, as the problem is a little bit more complex.
Is there any solution using PowerShell?
Regards
marius
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Getting information about jobs in order to re-create the

Post by nielsengelen »

Cloning is not possible in standard edition.

The following gets all objects in all jobs and should get you started:

Code: Select all

Add-PSSnapin VeeamPSSnapin

$Jobs = Get-VBRJob

foreach ($Job in $Jobs) {
    $Objects = $Job.GetObjectsInJob()
    $Objects
}
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Getting information about jobs in order to re-create the

Post by marius roma »

Many thanks.
Is there a similar command to create a new job?
Regards
Marius
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Getting information about jobs in order to re-create the

Post by veremin »

You will need to locate Virtual Machines those backup objects represent and pass them to Add-VBRViBackupJob cmdlet. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests