Enable-​Azure​Rm​Backup​Protection

Associates an item with an Azure Backup protection policy.

Syntax

Enable-AzureRmBackupProtection
      [-Item] <AzureRMBackupContainerContextObject>
      -Policy <AzureRMBackupProtectionPolicy>
      [<CommonParameters>]

Description

The Enable-AzureRmBackupProtection cmdlet associates an item with an Azure Backup protection policy. To enable a protection policy, you must first have an existing backup item and an existing policy. Both must belong to the same Backup vault. The backup schedule does the full initial copy for the item and the incremental copy for the subsequent backups.

Examples

Example 1: Enable protection on an Azure virtual machine

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> $Policy = Get-AzureRmBackupProtectionPolicy -Vault $Vault -Name "DefaultPolicy"
PS C:\> Get-AzureRmBackupContainer -Vault $Vault -Type AzureVM -Status Registered | Get-AzureRmBackupItem | Enable-AzureRmBackupProtection -Policy $Policy
WorkloadName    Operation        Status          StartTime              EndTime
------------    ---------        ------          ---------              -------
co03-vm         ConfigureBackup  Completed       26-Aug-15 12:19:49 PM  26-Aug-15 12:19:54 PM

The first command gets the vault named Vault03 by using the Get-AzureRmBackupVault cmdlet. The command stores that object in the $Vault variable.

The second command gets the Backup protection policy named DefaultPolicy for the vault in $Vault. The command stores that object in the $Policy variable.

The final command uses the pipeline operator to pass values from one cmdlet to the next. It gets a container, by using the Get-AzureRmBackupContainer cmdlet. The command gets the backup item from that container by using the Get-AzureRmBackupItem cmdlet. The current cmdlet enables the policy stored in $Policy for the item that the command passes to that cmdlet.

Required Parameters

-Item

Specifies the Backup item for which this cmdlet enables protection. To obtain an AzureRmBackupItem, use the Get-AzureRmBackupItem cmdlet.

Type:AzureRMBackupContainerContextObject
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Policy

Specifies protection policy that this cmdlet associates with an item. To obtain an AzureRmBackupProtectionPolicy object, use the Get-AzureRmBackupProtectionPolicy cmdlet.

Type:AzureRMBackupProtectionPolicy
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRmBackupItem

Outputs

AzureRmBackupJob