PowerShell script exchange
Post Reply
Alan_Eden
Novice
Posts: 4
Liked: never
Joined: Aug 06, 2009 1:48 pm
Full Name: Alan Eden
Contact:

Powershell Scripts specifying folder containers

Post by Alan_Eden »

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
Gostev
Chief Product Officer
Posts: 31531
Liked: 6703 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Powershell Scripts specifying folder containers

Post by Gostev »

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.
Vitaliy S.
VP, Product Management
Posts: 27114
Liked: 2720 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Powershell Scripts specifying folder containers

Post by Vitaliy S. »

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

Who is online

Users browsing this forum: No registered users and 8 guests