New-VBRJobOptions

In this article

    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 3 parameter sets.

    • For editing all job options:

    New-VBRJobOptions  [<CommonParameters>]

    • For editing backup jobs options:

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

    • For editing replication jobs options:

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

    Detailed Description

    This cmdlet returns default job settings. You can edit any setting that you want to apply to a job.

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

    Parameters

    Parameter

    Description

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    ForBackupJob

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

    False

    Named

    False

    False

    ForReplicaJob

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

    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.

    Example

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

    You will need to perform the following steps:

    1. Run New-VBRJobOptions to get the object with the default backup job settings. Save the result to the $retention variable.
    2. Edit the backup storage settings. Use the RetainCycles parameter of the BackupStorageOptions object to specify the number of restore points.
    3. Run Get-VBRJob to get the job to which you want to apply the retention policy. Save the result to the $job variable.
    4. Run Set-VBRJobOptions with the $job and $retention variables to apply the retention policy.

    $retention = New-VBRJobOptions -ForBackupJob

    $retention.BackupStorageOptions.RetainCycles = 7

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

    Set-VBRJobOptions -Job $job -Options $retention

    Related commands

    Get-VBRJob

    Set-VBRJobOptions