PowerShell script exchange
Post Reply
victor.bylin@atea.se
Service Provider
Posts: 29
Liked: 1 time
Joined: Oct 26, 2017 11:22 am
Full Name: Victor
Contact:

Need help enabling "During the following time period only:" option

Post by victor.bylin@atea.se » Jan 31, 2019 2:38 pm

Hi,

I can't figure out how to enable the "During the following time period only:" in schedule for a Backup Copy job.
I am able to create the correct Schedule but not enabling it.
I thought it was as below but that does not enable it just put the correct time window.
And the value has OptionsContinuous.Enabled is true but what other option do you have to enable?

Code: Select all

  
  
$ScheduleOptions = $job.ScheduleOptions
$ScheduleOptions.OptionsContinuous.Schedule = $AllowedtoRun
$ScheduleOptions.OptionsContinuous.Enabled = $true
Set-VBRJobScheduleOptions -Job $job -Options $ScheduleOptions        
            
Best regards!

Lucas_H
Influencer
Posts: 17
Liked: 4 times
Joined: Nov 16, 2018 3:14 pm
Full Name: Lucas HELLMANN
Location: Lyon, FRANCE
Contact:

Re: Need help enabling "During the following time period only:" option

Post by Lucas_H » Feb 01, 2019 8:20 am

Hello,

This is the good parameter :

Code: Select all

$Options.JobOptions.BackupCopyJobCanRunAnyTime = $false
(true for continuous run and false to specify a time period)

Here is the script I use :

Code: Select all

$JobName = "Backup Copy Name"
$Job = Get-VBRJob -Name $JobName
$Options = $Job.Options
$Options.JobOptions.BackupCopyJobCanRunAnyTime = $false
Set-VBRJobOptions $Job $Options | Out-Null
Cheers,
Lucas H

victor.bylin@atea.se
Service Provider
Posts: 29
Liked: 1 time
Joined: Oct 26, 2017 11:22 am
Full Name: Victor
Contact:

Re: Need help enabling "During the following time period only:" option

Post by victor.bylin@atea.se » Feb 01, 2019 11:23 am

Thanks alot Lucas! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests