Backup-AzureRmRecoveryServicesBackupItem

Starts a backup for a Backup item.

Syntax

Backup-AzureRmRecoveryServicesBackupItem
      -Item <ItemBase>
      [-ExpiryDateTimeUTC <DateTime>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Backup-AzureRmRecoveryServicesBackupItem cmdlet starts a backup for a protected Azure Backup item that is not tied to the backup schedule. You can do an initial backup immediately after you enable protection or start a backup after a scheduled backup fails.

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

Examples

Example 1: Start a backup for a Backup item

PS C:\> $NamedContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureVM -Status Registered -Name "pstestv2vm1" 
PS C:\> $Item = Get-AzureRmRecoveryServicesBackupItem -Container $NamedContainer -WorkloadType AzureVM 
PS C:\> $Job = Backup-AzureRmRecoveryServicesItem -Item $Item
Operation        Status               StartTime            EndTime                   JOBID                           
------------     ---------            ------               ---------                 -------                                         
pstestv2vm1      Backup               InProgress           4/23/2016 5:00:30 PM      cf4b3ef5-2fac-4c8e-a215-d2eba4124f27

The first command gets the Backup container of type AzureVM named pstestv2vm1, and then stores it in the $NamedContainer variable.

The second command gets the Backup item corresponding to the container in $NamedContainer, and then stores it in the $Item variable.

The last command triggers the backup job for the Backup item in $Item.

Required Parameters

-Item

Specifies a Backup item for which this cmdlet starts a backup operation.

Type:Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ItemBase
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:System.Management.Automation.SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExpiryDateTimeUTC

Specifies an expiry time as a DateTime object.

Type:System.Nullable`1[System.DateTime]
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

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

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

DateTime

Parameter 'ExpiryDateTimeUTC' accepts value of type 'DateTime' from the pipeline

Inputs

ItemBase

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

Outputs

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