Enable-AzRecoveryServicesBackupProtection
Enables backup for an item with a specified Backup protection policy.
Syntax
Enable-AzRecoveryServicesBackupProtection
[[-Policy] <PolicyBase>]
[-Name] <String>
[-ResourceGroupName] <String>
[-InclusionDisksList <String[]>]
[-ExclusionDisksList <String[]>]
[-ExcludeAllDataDisks]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-AzRecoveryServicesBackupProtection
[[-Policy] <PolicyBase>]
[-Name] <String>
[-ServiceName] <String>
[-InclusionDisksList <String[]>]
[-ExclusionDisksList <String[]>]
[-ExcludeAllDataDisks]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-AzRecoveryServicesBackupProtection
[[-Policy] <PolicyBase>]
[-Name] <String>
[-StorageAccountName] <String>
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-AzRecoveryServicesBackupProtection
[[-Policy] <PolicyBase>]
[-ProtectableItem] <ProtectableItemBase>
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-AzRecoveryServicesBackupProtection
[[-Policy] <PolicyBase>]
[-Item] <ItemBase>
[-InclusionDisksList <String[]>]
[-ExclusionDisksList <String[]>]
[-ResetExclusionSettings]
[-ExcludeAllDataDisks]
[-VaultId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Enable-AzRecoveryServicesBackupProtection cmdlet enables the backup by associating a protection policy with the item. If policy ID is not present or the backup item is not associated with any policy, then this command will expect a policyID. Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.
Examples
Example 1: Enable Backup protection for an item
$Pol = Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"
$inclusionDiskLUNS = ("1", "2")
Enable-AzRecoveryServicesBackupProtection -Policy $Pol -Name "V2VM" -ResourceGroupName "RGName1" -InclusionDisksList $inclusionDiskLUNS
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 specifies the disk LUNs which are to be backed up and stores it in $inclusionDiskLUNS variable. The third cmdlet sets the Backup protection policy for the ARM virtual machine named V2VM using the policy in $Pol.
Example 2
Enables backup for an item with a specified Backup protection policy. (autogenerated)
<!-- Aladdin Generated Example -->
Enable-AzRecoveryServicesBackupProtection -Item $Item -Policy $Pol -VaultId $vault
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Option to specify to backup OS disks only
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
List of Disk LUNs to be excluded in backup and the rest are automatically included.
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
List of Disk LUNs to be included in backup and the rest are automatically excluded except OS disk.
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Backup item for which this cmdlet enables protection. To obtain an AzureRmRecoveryServicesBackupItem, use the Get-AzRecoveryServicesBackupItem cmdlet.
| Type: | ItemBase |
| Position: | 4 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the Backup item.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies protection policy that this cmdlet associates with an item. To obtain an AzureRmRecoveryServicesBackupProtectionPolicy object, use the Get-AzRecoveryServicesBackupProtectionPolicy cmdlet.
| Type: | PolicyBase |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the item to be protected with the given policy.
| Type: | ProtectableItemBase |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies to reset disk exclusion setting associated with the item
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
| Accept wildcard characters: | False |
Cloud Service Name for Azure Classic Compute VM.
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Azure file share storage account name
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
ARM ID of the Recovery Services Vault.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Outputs
Related Links
الملاحظات
إرسال الملاحظات وعرضها المتعلقة بـ