PowerShell script exchange
Post Reply
victor.bylin@atea.se
Service Provider
Posts: 47
Liked: 2 times
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 »

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 »

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: 47
Liked: 2 times
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 »

Thanks alot Lucas! :)
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests