New-VBRJobOptions
Short Description
Creates new job options.
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
This cmdlet provides the following parameter sets:
-
AllParameterSets (Default)New-VBRJobOptions [<CommonParameters>]
-
ForBackupJobNew-VBRJobOptions [-ForBackupJob] [<CommonParameters>]
-
ForReplicaJobNew-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-VBRJobOptionsModifies job settings. 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. |
|
False |
Named |
False |
|
ForReplicaJob |
Defines that the cmdlet will return default settings for replication job. |
|
False |
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:
- Run the
New-VBRJobOptionscmdlet. Provide theForBackupJobparameter. Save the result to the$retentionvariable. - Specify the
RetainCyclesparameter of theBackupStorageOptionsobject for the$retentionvariable. - Run the
Get-VBRJobReturns existing jobs. cmdlet. Specify theNameparameter value. Save the result to the$jobvariable. - Run the
Set-VBRJobOptionsModifies job settings. cmdlet. Set the$jobvariable as theJobparameter value. Set the$retentionvariable as theOptionsparameter value.
Related Commands
Get-VBRJobReturns existing jobs.Set-VBRJobOptionsModifies job settings.