Unregister-​Azure​Rm​Backup​Container

Unregisters a container from a Backup vault.

Syntax

Unregister-AzureRmBackupContainer
          [-Container] <AzureRMBackupContainer>
          [-Force]
          [-Confirm]
          [-WhatIf]
          [<CommonParameters>]

Description

The Unregister-AzureRmBackupContainer cmdlet unregisters the Windows Server or Azure virtual machine from an Azure Backup vault. This cmdlet removes references to a container from the Backup vault. Before you can unregister a container, you must delete any protected data associated with that container.

Examples

Example 1: Unregister a Windows Server

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> $Container = Get-AzureRmBackupContainer -Vault $Vault -Type Windows -Name "server01.contoso.com"
PS C:\> Unregister-AzureRmBackupContainer -Container $Container[0]
Unregister Server
This operation will delete all data in the backup vault that is associated with the server. Are you sure you want to unregister the server? 
[] Yes  [] No  [?] Help (default is "No"): Yes

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 a container that has the specified name in the vault in $Vault by using the Get-AzureRmBackupContainer cmdlet. The command stores that object in the $Container variable.

The final command unregisters the specified Windows Server from the Azure Backup vault.

Example 2: Unregister a Windows Server without confirmation

PS C:\>Unregister-AzureRmBackupContainer -Container $Container[0] -Force

This command unregisters the specified Windows Server from the Azure Backup vault, just as in the first example. This command specifies the Force parameter. Therefore, the command does not prompt you for confirmation.

Required Parameters

-Container

Specifies the Windows Server or Azure virtual machine that this cmdlet unregisters. To obtain an AzureRmBackupContainer, use the Get-AzureRmBackupContainer cmdlet.

Type:AzureRMBackupContainer
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation. This parameter is relevant only for AzureBackupContainer objects of type Windows.

Type:SwitchParameter
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureBackupContainer

Outputs

AzureBackupJob

This cmdlet returns $Null if the container type is Windows Server.

Notes

  • None