New-VBRJobOptions

Short Description

Creates new job options.

Applies to

Platform: VMware, Hyper-V

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

Syntax

This cmdlet provides parameter sets that allow you to:

  • Edit all job options.

New-VBRJobOptions  [<CommonParameters>]]

  • Edit backup jobs options.

New-VBRJobOptions [-ForBackupJob]  [<CommonParameters>]

  • Edit replication jobs options.

New-VBRJobOptions [-ForReplicaJob]  [<CommonParameters>]

Detailed Description

This cmdlet returns the CJobOptions object. This object contains the default settings of the job you want to edit. You can customize any setting that you want to apply to a backup job, replication job or selected VMs.

Run the Set-VBRJobOptions cmdlet to apply the modified options to a job.

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

ForBackupJob

Defines that the cmdlet will return default settings for backup job.

SwitchParameter

Named

Named

False

ForReplicaJob

Defines that the cmdlet will return default settings for replication job.

SwitchParameter

Named

Named

False

<CommonParameters>

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

Examples

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. Provide the ForBackupJob parameter. 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.

Related commands