Help Center
Choose product document...
Veeam Backup & Replication 9.5 Update 4
PowerShell Reference

Set-VBRJobScriptOptions

Short Description

Modifies job script options.

Applies to

Product Edition: Community, Standard, Enterprise, Enterprise Plus

Syntax

Set-VBRJobScriptOptions -JobScriptOptions <VBRJobScriptOptions> [-PreScriptEnabled] [-PreCommand <string>][-PostScriptEnabled] [-PostCommand <string>]
[-Day <DayOfWeek[]> {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-Periodicity <VBRPeriodicityType> {Cycles | Days}]
[-Frequency <uint32>][<CommonParameters>]

Detailed Description

This cmdlet modifies pre-job and post-job script settings for backup jobs and for replication jobs.

To modify settings, enter the necessary parameters with new values. The parameters that you omit will remain unchanged.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

JobScriptOptions

Specifies the script options that you want to modify

Accepts the VBRJobScriptOptions type.

True

Named

False

 

PreScriptEnabled

Indicates that you want to run a script before the job.

False

Named

False

 

PreCommand

For the PreScriptEnabled parameter.

Specifies the path to the pre-job script.

False

Named

False

 

PostScriptEnabled

Indicates that you want to run a script after the job.

False

Named

False

 

PostCommand

For the PostScriptEnabled parameter.

Specifies the path to the post-job script.

False

Named

False

 

Periodicity

Specifies the script run schedule:

  • Cycles: to run scripts after the specified number of backup sessions.
  • Days: to run scripts on the selected days.

Use the Day and the Frequency parameters to set the values.

False

Named

False

 

Day

For the Days option.

Specifies the days of the week when the script must run.

False

Named

False

 

Frequency

For the Cycles option.

Specifies the number of backup sessions after which the script must run.

False

Named

False

 

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Return Type

Example

This example shows how to modify the script schedule with the following settings: Veeam Backup & Replication will run the scripts after 15 backup sessions.

  1. Run Get-VBRJob to get the backup job that you want to modify. Save the result to the $job variable.
  2. Cast the backup job to the VBRComputerBackupJob type. Use the [Veeam.Backup.PowerShell.Infos.VBRComputerBackupJob]$ComputerBackupJob value.
  3. Get the ScriptOptions object. Save the result to the $script variable.
  4. Cast the $script variable to the VBRJobScriptOptions type. Use the [Veeam.Backup.PowerShell.Infos.VBRJobScriptOptions]$JobScriptOptions value. Save the result to the $script variable.
  5. Run Set-VBRJobScriptOptions with the $script variable. Set the Days value for the Periodicity parameter to run the script on Thursdays.

$job = Get-VBRJob -Name "BackupJob"

[Veeam.Backup.PowerShell.Infos.VBRComputerBackupJob]$ComputerBackupJob = $job

$script = $ComputerBackupJob.ScriptOptions

[Veeam.Backup.PowerShell.Infos.VBRJobScriptOptions]$JobScriptOptions = $script

Set-VBRJobScriptOptions -JobScriptOptions $script -Periodicity Days -Day Thursday

Related Commands

Get-VBRJob

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Explorers User Guide

Backup and Restore of SQL Server Databases

Veeam Plug-ins for Enterprise Applications

PowerShell Reference

Veeam Explorers PowerShell Reference

RESTful API Reference

Required Permissions

Veeam Availability for Nutanix AHV

Veeam Backup for Microsoft Office 365 Documentation

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation