< Back

Enable-AzureRmBackupProtection

Tue Jan 29, 2019 9:34 pm

NAME Enable-AzureRmBackupProtection



SYNOPSIS

Associates an item with an Azure Backup protection policy.





SYNTAX

Enable-AzureRmBackupProtection [-Item] <AzureRMBackupContainerContextObject> [-DefaultProfile <IAzureContextContainer>] -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.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Item <AzureRMBackupContainerContextObject>

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



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Policy <AzureRMBackupProtectionPolicy>

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

Get-AzureRmBackupProtectionPolicy cmdlet.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

AzureRmBackupItem







OUTPUTS

AzureRmBackupJob







NOTES









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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... protection

Backup-AzureRmBackupItem

Get-AzureRmBackupItem

Get-AzureRmBackupProtectionPolicy