Creating a backup job for a template

PowerShell script exchange

Creating a backup job for a template

Veeam Logoby Amerloc » Thu Mar 08, 2012 2:18 pm

I'm using the same command for creating backup jobs for VMs and templates:
Code: Select all
Add-VBRBackupJob -Name "JobName" -Type "NET" -Server $server -Folder "DestinationFolder" -Filename "Filename" -Objects "Template_or_VM"

When the object is a VM the job is created correctly, but when the object is a template, the job is created but the object is not added, I have to add it manually using th GUI.
Amerloc
Influencer
 
Posts: 12
Liked: 1 time
Joined: Thu Mar 08, 2012 9:26 am
Full Name: Adolfo Alvarez

Re: Creating a backup job for a template

Veeam Logoby ThomasMc » Wed Mar 14, 2012 8:21 pm

pass it the object instead of using a string via the Find-VBRObject as its more reliable this way
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Creating a backup job for a template

Veeam Logoby Amerloc » Wed Mar 21, 2012 1:36 pm

Hi Thomas. Thanks for your reply.
When I run Find-VBRObject, no template is shown on the list and therefore, if I try to store the object name in a variable (i.e.: $obj = Find-VBRObject -Server $server|where {$_.name -eq "Template_Name"}) nothing is stored. ┬┐Is there some parameter needed to find template objects?
Amerloc
Influencer
 
Posts: 12
Liked: 1 time
Joined: Thu Mar 08, 2012 9:26 am
Full Name: Adolfo Alvarez

Re: Creating a backup job for a template

Veeam Logoby jlsung » Thu Mar 29, 2012 9:11 am

Hi,
You can use this :
Find-VBRObject $server | where {$_.IsTemplate}
jlsung
Influencer
 
Posts: 21
Liked: never
Joined: Thu Sep 15, 2011 1:41 pm

Re: Creating a backup job for a template

Veeam Logoby Amerloc » Mon Apr 02, 2012 12:44 pm

Hi jlsung. Thank you for your help.
I have tried what you told but as "where {$_.IsTemplate}" is a filter for the "Find-VBRObject" and "Find-VBRObject" doesn't show any template, the "Find-VBRObject $server | where {$_.IsTemplate}" neither shows any template. :-(
Amerloc
Influencer
 
Posts: 12
Liked: 1 time
Joined: Thu Mar 08, 2012 9:26 am
Full Name: Adolfo Alvarez

Re: Creating a backup job for a template

Veeam Logoby jlsung » Thu Apr 05, 2012 7:41 am

Hi,

I tried again Find-VBRObject $vcenter | where {$_.IsTemplate} and it shows only template in my vcenter :roll:
jlsung
Influencer
 
Posts: 21
Liked: never
Joined: Thu Sep 15, 2011 1:41 pm

Re: Creating a backup job for a template

Veeam Logoby ThomasMc » Fri Apr 13, 2012 4:56 pm 1 person likes this post

jlsung wrote:Hi,

I tried again Find-VBRObject $vcenter | where {$_.IsTemplate} and it shows only template in my vcenter :roll:


Same as above

Code: Select all
PS C:\Users\administrator.VPOWERCLI> Find-VBRObject -server $server | ?{$_.IsTemplate}

Name                      MemoryInMB PowerState     IsTemplate Ref
----                      ---------- ----------     ---------- ---
LAB Template DC           2048       PoweredOff     True       vm-83
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests