Add-VBRHvJobObject

Short Description

Adds VMs to Hyper-V jobs.

Applies to

Platform: Hyper-V

For VMware, run the Add-VBRViJobObject cmdlet.

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

Syntax

Add-VBRHvJobObject -Entities <IHvItem[]> [-Force] -Job <CBackupJob>  [<CommonParameters>]

Detailed Description

This cmdlet adds VMs to Hyper-V jobs.

You can run this cmdlet with any kind of jobs.

Add-VBRHvJobObject Note:

The cmdlet will not run if the geographic location of the VMs added to the job and the job target repository location do not match. If you still want to run the cmdlet, use the Force parameter.

Parameters

Parameter

Description

Type

Required

Position

Accept
Pipeline
Input

Job

Specifies the job. The cmdlet will add VMs to this job.

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

True

Named

False

Entities

Specifies the array of Hyper-V VMs you want to add to the job.

Accepts the IHvItem[] object. To get this object, run the Find-VBRHvEntity cmdlet.

True

Named

True (ByProperty
Name, ByValue)

Force

Defines that the cmdlet will add VMs to the existing job even if the geographic location of these VMs and the target backup repository location do not match.

SwitchParameter

False

Named

False

<CommonParameters>

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

Examples

Add-VBRHvJobObjectExample 1. Adding VM to Job Represented by Variable [Using Pipeline]

This example shows how to add a VM named VM01 to the job represented by the $BackupHVJob variable.

$BackupHvJob = Get-VBRJob -Name "Backup Job"

Find-VBRHvEntity -Name VM01 | Add-VBRHvJobObject -Job $BackupHvJob

Perform the following steps:

  1. Run the Get-VBRJob cmdlet. Specify the Name parameter value. Save the result to the $BackupHvJob variable.
  2. Run the Find-VBRHvEntity cmdlet. Specify the Name parameter value.
  3. Pipe the cmdlet output to the Add-VBRHvJobObject cmdlet. Set the $BackupHvJob variable as the Job parameter value.

Add-VBRHvJobObjectExample 2. Adding VM to Specific Job [Using Variables]

This example shows how to add a VM represented by $Vm variable to the job represented by $BackupHvJob variable.

$BackupHvJob = Get-VBRJob -Name "Backup Job"

$Vm = Find-VBRHvEntity -Name "VM01"

Add-VBRHvJobObject -Job $BackupHvJob -Entities $Vm

Perform the following steps:

  1. Run the Get-VBRJob cmdlet. Specify the Name parameter value. Save the result to the $BackupHvJob variable.
  2. Run the Find-VBRHvEntity cmdlet. Specify the Name parameter value. Save the result to the $Vm variable.
  3. Run the Add-VBRHvJobObject cmdlet. Set the $BackupHvJob variable as the Job parameter value. Set the $Vm variable as the Entities parameter value.

Related Commands

Page updated 6/11/2024

Page content applies to build 12.2.0.334