Set-VBRJobOptions

Short Description

Modifies job settings.

Applies to

Platform: VMware, Hyper-V

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

Set-VBRJobOptions [-Job] <CBackupJob[]> [[-Options] <CJobOptions>] [-HighPriority]  [<CommonParameters>]

Detailed Description

This cmdlet applies customized settings to a selected job.

Run the New-VBRJobOptions cmdlet to create the CJobOptions object. This object unifies all the options you want to apply to the job.

Note

To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameters values with new values. The parameters that you omit will remain unchanged.

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

Job

Specifies the job you want to edit.

Accepts the CBackupJob object. To create this object, run the Get-VBRJob cmdlet.

True

0

True (ByProperty
Name, ByValue)

Options

Specifies the set of parameters you want to apply to the job.

Accepts the CJobOptions object. To create this object, run the New-VBRJobOptions cmdlet.

False

1

False

HighPriority

Note: This parameter is available starting from Veeam Backup & Replication 11a (build 11.0.1.1261).

Defines that Veeam Backup & Replication will prioritize this job higher than other similar jobs and allocate resources to it first.

SwitchParameter

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Examples

Set-VBRJobOptionsExample 1. Defining Retention Policy for Backup Job

This example shows how to define the retention policy for a backup job.

$retention = New-VBRJobOptions -ForBackupJob

$retention.BackupStorageOptions.RetainCycles = 7

$job = Get-VBRJob -Name "ABC Backup"

Set-VBRJobOptions -Job $job -Options $retention

Perform the following steps:

  1. Run the New-VBRJobOptions cmdlet. Save the result to the $retention variable.
  2. Specify the RetainCycles parameter of the BackupStorageOptions object for the $retention variable.
  3. Run the Get-VBRJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
  4. Run the Set-VBRJobOptions cmdlet. Set the $job variable as the Job parameter value. Set the $retention variable as the Options parameter value.

Set-VBRJobOptionsExample 2. Applying Custom Settings to Specific Backup Job [Using Pipeline]

This example shows how to apply custom settings to the backup job named Backup Job 01.

$options = New-VBRJobOptions

Get-VBRJob -Name "Backup Job 01" | Set-VBRJobOptions -Options $options

Perform the following steps:

  1. Run the New-VBRJobOptions cmdlet. Save the result to the $options variable.
  2. Run the Get-VBRJob cmdlet. Specify the Name parameter value.
  3. Pipe the cmdlet output to the Set-VBRJobOptions cmdlet. Set the $options variable as the Options parameter value.

Set-VBRJobOptionsExample 3. Applying Custom Settings to Backup Job [Using Variable]

This example shows how to apply custom settings to the backup job represented by the $job variable.

$job = Get-VBRJob

$options = New-VBRJobOptions

Set-VBRJobOptions -Job $job -Options $options

Perform the following steps:

  1. Run the Get-VBRJob cmdlet. Save the result to the $job variable.
  2. Run the New-VBRJobOptions cmdlet. Save the result to the $options variable.
  3. Run the Set-VBRJobOptions cmdlet. Set the $job variable as the Job parameter value. Set the $options variable as the Options parameter value.

Related Commands