Sample Header Ad - 728x90

How to check AutoProtect setting for Azure Backup using PowerShell?

0 votes
1 answer
363 views
We have about 30 SQL instances being backed up by Azure Backup. I have the needed PowerShell commands to *set* the AutoProtect policy, but there doesn't seem to be a command to *get* the AutoProtect status or policy. Anyone got any ideas how to get this via PowerShell? In case anyone is interested, here is the code to *set* the policy: $vault = Get-AzRecoveryServicesVault -ResourceGroupName "MyResourceGroupName" -Name "MyRSVname" $pol = Get-AzRecoveryServicesBackupProtectionPolicy -Name "MyPolicyName" $sqlinstances = Get-AzRecoveryServicesBackupProtectableItem -workloadType MSSQL -ItemType SQLInstance -VaultId $vault.ID foreach ($SQLInstance in $sqlinstances) { Enable-AzRecoveryServicesBackupAutoProtection -InputItem $SQLInstance -BackupManagementType AzureWorkload -WorkloadType MSSQL -Policy $pol -VaultId $vault.ID }
Asked by Mike (692 rep)
Jan 5, 2023, 01:09 AM
Last activity: Jan 21, 2025, 08:04 PM