Unregister-AzureRmBackupContainer

Unregisters a container from a Backup vault.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Unregister-AzureRmBackupContainer
          [-Force]
          [-Container] <AzureRMBackupContainer>
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<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.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required: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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRMBackupContainer

Parameters: Container (ByValue)

Outputs

AzureRMBackupJob

Notes

  • None