Created
April 19, 2018 16:04
-
-
Save ejschaefer/46b9d3ff5f6bd5e46c4b332cd25531cd to your computer and use it in GitHub Desktop.
List Azure VM Backups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Get All Recovery Services Vaults | |
| $vaults = Get-AzureRMRecoveryServicesVault | |
| #Loop through all RS Vaults and output details for each container (VM) | |
| foreach ($vault in $vaults) | |
| { | |
| Set-AzureRmRecoveryServicesVaultContext -Vault $vault | |
| $containers = Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" | |
| foreach ($container in $containers) | |
| { | |
| $item = Get-AzureRmRecoveryServicesBackupItem -Container $container -WorkloadType "AzureVM" #| select ContainerName,LatestRecoveryPoint | |
| Write-Output "$($container.FriendlyName), $($container.ResourceGroupName), $($container.Status), $($item.ProtectionPolicyName), $($item.LatestRecoveryPoint), $($vault.Name), $($vault.ResourceGroupName), $($vault.Location)" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment