replication choose a specific datastore

PowerShell script exchange

replication choose a specific datastore

Veeam Logoby half_lif3 » Wed Mar 07, 2012 4:45 am

Hi,

I'm on the midst on evaluating veeam v6 and starting to exploring the powershell feature.
While I'm having some issue on creating replication jobs via powershell.
Can anyone provide me an example on how to schedule a replication job on specific time and under specific datastore?

Code: Select all

$GSServer = Find-VBRViEntity -name vmserver
$BKServer = Get-VBRServer | where {$_.Name -eq "192.168.0.178"}
$BKDS = Find-VBRDatastore -Server ($BKServer) | where {$_.Name -eq "datastore01"}

Add-VBRViReplicaJob -Name BK_vmserver -Server ($BKServer) -Entity ($GSServer) -Datastore ($BKDS)



The error I"m getting is "Add-VBRViReplicaJob : Cannot bind parameter 'Datastore'. Cannot convert the "da
tastore01" value of type "Veeam.Backup.ViSoap.Datastore" to type "Veeam.Backup.C
ore.Infrastructure.CViDatastoreItem"."
half_lif3
Novice
 
Posts: 4
Liked: never
Joined: Wed Mar 07, 2012 4:34 am

Re: replication choose a specific datastore

Veeam Logoby ThomasMc » Wed Mar 07, 2012 10:12 am

This is what you'll be wanting :)

Code: Select all
$BKServer = Get-VBRServer -Name "192.168.0.178"
$BKDS = Find-VBRViDatastore -Server $BKServer -Name "datastore01"
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: replication choose a specific datastore

Veeam Logoby half_lif3 » Thu Mar 08, 2012 9:27 am

Hi, Thanks. Will work out on a script to schedule 50 jobs to backup 50 different VMs :oops:
half_lif3
Novice
 
Posts: 4
Liked: never
Joined: Wed Mar 07, 2012 4:34 am

Re: replication choose a specific datastore

Veeam Logoby half_lif3 » Thu Mar 08, 2012 4:40 pm

Refer to my below code. I've run and the options "Run the job automatically" for the job still remain un-tick.
Can i know what is the options available?

Code: Select all
$job = Get-VBRJob -name "BK_vmserver"
$schedule = $job |Get-VBRjobscheduleoptions

$schedule.OptionsDaily.Enabled = $true
$schedule.OptionsDaily.Kind = "SelectedDays"
$schedule.OptionsDaily.Days = "Monday", "Wednesday", "Friday"
$schedule.OptionsDaily.Time = "12:00:00"

Set-VBRJobScheduleOptions -Job $job -Options $schedule
half_lif3
Novice
 
Posts: 4
Liked: never
Joined: Wed Mar 07, 2012 4:34 am

Re: replication choose a specific datastore

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

is it version 5 your using?
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: replication choose a specific datastore

Veeam Logoby half_lif3 » Thu Mar 15, 2012 2:01 am

negative. I'm using Version 6 :S
half_lif3
Novice
 
Posts: 4
Liked: never
Joined: Wed Mar 07, 2012 4:34 am

Re: replication choose a specific datastore

Veeam Logoby ThomasMc » Thu Mar 15, 2012 10:29 am

This is what your after

Code: Select all
$job = Get-VBRJob -Name "Job Name"
$job.options.JobOptions.RunManually = $false
$job.EnableScheduler()
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 4 guests