Enable-​Azure​Rm​Recovery​Services​Backup​Protection

Enables backup for an item with a specified Backup protection policy.

Syntax

Enable-AzureRmRecoveryServicesBackupProtection
      [-Policy] <PolicyBase>
      [-ResourceGroupName] <String>
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      -Name <String>
      [<CommonParameters>]
Enable-AzureRmRecoveryServicesBackupProtection
      [-Policy] <PolicyBase>
      [-ServiceName] <String>
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      -Name <String>
      [<CommonParameters>]
Enable-AzureRmRecoveryServicesBackupProtection
      [-Policy] <PolicyBase>
      [-Item] <ItemBase>
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [<CommonParameters>]

Description

The Enable-AzureRmRecoveryServicesBackupProtection cmdlet sets Azure Backup protection policy on an item.

Set the vault context by using the Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Enable Backup protection for an item

PS C:\> $Pol = Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"
PS C:\> Enable-AzureRmRecoveryServicesBackupProtection -Policy $Pol -Name "V2VM" -ResourceGroupName "RGName1"
WorkloadName    Operation        Status          StartTime                  EndTime
------------    ---------        ------          ---------                  -------
co03-vm         ConfigureBackup  Completed       11-Apr-16 12:19:49 PM      11-Apr-16 12:19:54 PM

The first cmdlet gets a default policy object, and then stores it in the $Pol variable.

The second cmdlet sets the Backup protection policy for the ARM virtual machine named V2VM using the policy in $Pol.

Required Parameters

-Item

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

Type:ItemBase
Position:4
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the Backup item.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Policy

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

Type:PolicyBase
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group. Specify this parameter only for ARM virtual machines.

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServiceName

Specifies the service name. Specify this parameter only for ASM virtual machines.

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False