< Back

Enable-AzureRmRecoveryServicesBackupProtection

Tue Jan 29, 2019 10:00 pm

NAME Enable-AzureRmRecoveryServicesBackupProtection



SYNOPSIS

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





SYNTAX

Enable-AzureRmRecoveryServicesBackupProtection [-Policy] <PolicyBase> [-Item] <ItemBase> [-DefaultProfile <IAzureContextContainer>] [-Confirm]

[-WhatIf] [<CommonParameters>]



Enable-AzureRmRecoveryServicesBackupProtection [-Policy] <PolicyBase> [-Name] <String> [-ResourceGroupName] <String> [-DefaultProfile

<IAzureContextContainer>] [-Confirm] [-WhatIf] [<CommonParameters>]



Enable-AzureRmRecoveryServicesBackupProtection [-Policy] <PolicyBase> [-Name] <String> [-ServiceName] <String> [-DefaultProfile

<IAzureContextContainer>] [-Confirm] [-WhatIf] [<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.





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 <ItemBase>

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

Get-AzureRmRecoveryServicesBackupItem cmdlet.



Required? true

Position? 4

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Name <String>

Specifies the name of the Backup item.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Policy <PolicyBase>

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

the Get-AzureRmRecoveryServicesBackupProtectionPolicy cmdlet.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

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



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServiceName <String>

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



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

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

ItemBase

Parameter 'Item' accepts value of type 'ItemBase' from the pipeline





OUTPUTS

Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.JobBase







NOTES









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.







RELATED LINKS

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

Disable-AzureRmRecoveryServicesBackupProtection

Get-AzureRmRecoveryServicesBackupProtectionPolicy