To delete a Recovery Services vault:
// phase 1
- Sign in to your Azure account.
- Sign in to your Azure subscription with the Connect-AzureRmAccount command and follow the on-screen directions.
- PowerShell Copy
- The first time you use Azure Backup, you must register the Azure Recovery Service provider in your subscription with Register-AzureRmResourceProvider.
- Register-AzureRmResourceProvider -ProviderNamespace “Microsoft.RecoveryServices”
Get Information of Recovery Service.
Unregister Server from backup
$Cont = Get-AzureRmRecoveryServicesBackupContainer -ContainerType “Windows” -BackupManagementType MARS -Name “win-bjbrvac12rh.”
Unregister-AzureRmRecoveryServicesBackupContainer -Container $Cont
- Open a PowerShell window with Administrator privileges.
- Use Set-ExecutionPolicy Unrestricted to remove any restrictions.
- Run the following command to download the Azure Resource Manager Client package from chocolately.org.
- iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))
- Use the following command to install the Azure Resource Manager API Client.
- choco.exe install armclient
- In the Azure portal, gather the Subscription ID and associated resource group name for the Recovery Services vault you want to delete.
- In PowerShell, run the following command using your subscription ID, resource group name, and Recovery Services vault name. When you run the command, it deletes the vault and all dependencies.
ARMClient.exe delete /subscriptions/<subscriptionID>/resourceGroups/<resourcegroupname>/providers/Microsoft.RecoveryServices/vaults/<recovery services vault name>?api-version=2015-03-15