Skip to content

SurajSPujari/SQL-AzureBackup-Disable-using-Powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

# SQL-AzureBackup-Disable-using-Powershell
#Collection of commands given below will remove Recovery points of all the databases configured under given "server_name". Helpful when you have to disable thousands of DBs coming from a given server without which deleting the server from Server protection will not work.
$vault=Get-AzRecoveryServicesVault -name <Vault-Name>
Set-AzRecoveryServicesVaultContext -Vault $vault
$bkpItem = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureWorkload -WorkloadType MSSQL -VaultId $vault.ID
$Item=$bkpItem| Where-Object { $_.ServerName -eq "server_name"}
foreach ($i in $Item)
{
Disable-AzRecoveryServicesBackupProtection -Item $i -VaultId $vault.ID -RemoveRecoveryPoints -Force 
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published