Skip to content

Instantly share code, notes, and snippets.

@mattwoolnough
Created October 17, 2019 18:50
Show Gist options
  • Save mattwoolnough/54a7abcbe0f92930d66743c6265b644d to your computer and use it in GitHub Desktop.
Save mattwoolnough/54a7abcbe0f92930d66743c6265b644d to your computer and use it in GitHub Desktop.
Remove Azure Backup and Vault
$VaultName = "RecoveryVault"
$ClientName = "desktop-mw."
$MyVault = Get-AzRecoveryServicesVault -ResourceGroupName $ResourceGroupName -Name $VaultName
$Cont = Get-AzRecoveryServicesBackupContainer -ContainerType "Windows" -BackupManagementType MARS -FriendlyName $ClientName -VaultId $MyVault.ID
Unregister-AzRecoveryServicesBackupContainer -Container $Cont
Get-AzRecoveryServicesVault -ResourceGroupName $ResourceGroupName -Name $VaultName | Remove-AzRecoveryServicesVault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment