
Set-VBRBackupWindowOptions
Short Description
Modifies job backup window settings.
Applies to
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus
Syntax
Set-VBRBackupWindowOptions -Options <VBRBackupWindowOptions> -FromDay <DayOfWeek> -FromHour <Int32> -ToDay <DayOfWeek> -ToHour <Int32> -Enabled [-PassThru] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] |
Detailed Description
This cmdlet modifies the job backup window settings. You can use it to extend the existing backup window or remove specific days and hours from it. To modify settings, you must enter the corresponding parameters with new values.
|
To modify the backup windows settings, you must provide the PassThru parameter in your scripts. If you omit this parameter, the backup window settings will not be modified. |
Parameters
Parameter | Description | Required | Position | Accept | Accept |
Options | Specifies the backup window settings you want to modify. | True | Named | True (ByValue, | False |
FromDay | Specifies the day of the week on which the backup window opens. The cmdlet will extend the backup window with this day or will remove that day from the backup window. Default: Sunday. | False | Named | False | False |
FromHour | Specifies the hour on which the backup window opens. The cmdlet will add this hour to the existing backup window or will remove that hour from the backup window. Default: 0. | False | Named | False | False |
ToDay | Specifies the day of the week on which the backup window ends. The cmdlet will extend the backup window with this day or will remove that day from the backup window. Default: Saturday. | False | Named | False | False |
ToHour | Specifies the hour on which the backup window ends. The cmdlet will add this hour to the existing backup window or will remove that hour from the backup window. Default: 23. | False | Named | False | False |
Enabled | Defines the cmdlet will extend the backup window or will remove specific days and hours from it. If you set this parameter to the Enabled:$false value, the cmdlet will remove the specified time period from the backup window. | False | Named | False | False |
PassThru | Indicates that the command returns the output object to the Windows PowerShell console. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.
Return Type
None.
Example 1
This example shows how to modify the job backup window settings. The cmdlet will specify the time when the backup job is not allowed to run.
- The New-VBRBackupWindowOptions cmdlet defines the following backup window settings: the job is allowed to run from 10:00 AM till 22.59 PM on Monday, Tuesday, Wednesday and Thursday.
- The Set-VBRBackupWindowOptions modifies these settings. The job is not allowed to run from 10.00 AM till 12.59 AM on Tuesday and Wednesday.
Perform the following steps:
- Run the New-VBRBackupWindowOptions cmdlet. Specify the necessary parameters. Save the result to the $windowoptions variable.
- Run the Set-VBRBackupWindowOptions cmdlet. Specify the following settings:
- Set the $windowoptions variable as the Options parameter value.
- Specify the FromDay parameter value.
- Specify the FromHour parameter value.
- Specify the ToDay parameter value.
- Specify the ToHour parameter value.
- Set the Enabled parameter to the $false value.
- Provide the PassThru parameter.
- Save the result to the $windowoptions variable.
- Run the Set-VBRJobSchedule cmdlet. Set the $windowoptions variable as the PeriodicallySchedule parameter value. Provide the necessary parameters.
$windowoptions = New-VBRBackupWindowOptions -FromDay Monday -FromHour 10 -ToDay Thursday -ToHour 22 -Enabled $windowoptions = Set-VBRBackupWindowOptions -Options $windowoptions -FromDay Tuesday -FromHour 10 -ToDay Wednesday -ToHour 12 -Enabled:$false -PassThru Set-VBRJobSchedule -Job $job -PeriodicallySchedule $windowoptions -Periodicaly -FullPeriod 6 -PeriodicallyKind Hours |
Example 2
This example shows how to modify the job backup window settings. The cmdlet will extend the backup window to specify when the backup job is allowed to run.
- The New-VBRBackupWindowOptions cmdlet defines the following backup window settings: the job is allowed to run from 10:00 AM till 22.59 PM on Monday, Tuesday, Wednesday and Thursday.
- The Set-VBRBackupWindowOptions modifies these settings. The backup window is extended from 10.00 AM till 12.59 AM on Friday and Saturday.
Perform the following steps:
- Run the New-VBRBackupWindowOptions cmdlet. Specify the necessary parameters. Save the result to the $windowoptions variable.
- Run the Set-VBRBackupWindowOptions cmdlet. Specify the following settings:
- Set the $windowoptions variable as the Options parameter value.
- Specify the FromDay parameter value.
- Specify the FromHour parameter value.
- Specify the ToDay parameter value.
- Specify the ToHour parameter value.
- Provide the Enabled parameter.
- Provide the PassThru parameter.
- Save the result to the $windowoptions variable.
- Run the Set-VBRJobSchedule cmdlet. Set the $windowoptions variable as the PeriodicallySchedule parameter value. Provide the necessary parameters.
$windowoptions = New-VBRBackupWindowOptions -FromDay Monday -FromHour 10 -ToDay Thursday -ToHour 22 -Enabled $windowoptions = Set-VBRBackupWindowOptions -Options $windowoptions -FromDay Friday -FromHour 10 -ToDay Saturday -ToHour 12 -Enabled -PassThru Set-VBRJobSchedule -Job $job -Periodicaly -FullPeriod 6 -PeriodicallyKind Hours -PeriodicallySchedule $windowoptions |
Related Commands