Powershell Scripts specifying folder containers

PowerShell script exchange

Powershell Scripts specifying folder containers

Veeam Logoby Alan_Eden » Mon Apr 26, 2010 1:48 pm

I'm trying to powershell script the creation of backup jobs within Veeam, using folder containers that don't have unique names.

In the folders and templates view we have:

Code: Select all
Development
|-- AD
|-- SQL
|-- ISA
|-- MOSS
Approval
|-- AD
|-- SQL
|-- ISA
|-- MOSS
Production
|-- AD
|-- SQL
|-- ISA
|-- MOSS


So that the "AD", "SQL" etc container names exist in multiple places in the folder structure.

I can manually create the jobs to backup the Production AD servers to one set by browsing the folder structure when creating the job, but haven't found a way to script this yet.

The command I'm using is:
Code: Select all
Add-VBRBackupJob "Per-IDM-IB3 Set 1" VDDK "san;nbd" "My Computer" "\\172.28.3.15\z$\Veeam 4" "IntegrationAD" "AD"


Which returns:

Code: Select all
Add-VBRBackupJob : A parameter cannot be found that matches parameter name 'AD'.
At line:1 char:17
+ Add-VBRBackupJob  <<<< "Per-IDM-IB3 Set 1" VDDK "san;nbd" "My Computer" "\\172.28.3.15\z$\Veeam 4" "IntegrationAD" "AD"


When I run the same command without specifying the objects, and then enter the object when prompted; the backup job is created but with an empty backup job.

Is it possible to use folder containers when creating a backup job with a script?

Thanks,
Alan
Alan_Eden
Novice
 
Posts: 4
Liked: never
Joined: Thu Aug 06, 2009 1:48 pm
Full Name: Alan Eden

Re: Powershell Scripts specifying folder containers

Veeam Logoby Gostev » Mon Apr 26, 2010 4:30 pm

Hi Alan, I am out of office traveling right now, but I will try to get some information for you. Please ping in a few days if you don't hear from me here.
Gostev
Veeam Software
 
Posts: 21396
Liked: 2350 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Powershell Scripts specifying folder containers

Veeam Logoby Vitaliy S. » Thu Apr 29, 2010 11:02 am

Alan,

It seems like you've missed an -Objects option while creating your script:

Code: Select all
Add-VBRBackupJob "Per-IDM-IB3 Set 1" VDDK "san;nbd" "My Computer" "\\172.28.3.15\z$\Veeam 4" -Objects "IntegrationAD", "AD"

In this case you'll add all VMs that are located in IntegrationAD and AD folders from multiple places, because it is not possible to specify an exact folder right now, as a workaorund you could rename the folders by adding some kind of prefix for example.

Thank you!
Vitaliy S.
Veeam Software
 
Posts: 19575
Liked: 1106 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests