Code: Select all
$rp = (Get-VBRBackup -Name $backup_name| Get-VBRRestorePoint -Name $VM_NAME| Sort-Object –Property CreationTime | Select-Object -First 1)
Mohamed.
Code: Select all
$rp = (Get-VBRBackup -Name $backup_name| Get-VBRRestorePoint -Name $VM_NAME| Sort-Object –Property CreationTime | Select-Object -First 1)
Code: Select all
$rps = Get-VBRBackup -Name "<backup-name>" | Get-VBRRestorePoint -Name "<vm-name>" | Sort-Object -Property CreationTime
foreach ($rp in $rps){
$backupFile = $rp.GetRestoreStorages() | Select-Object -First 1
$rp | Select-Object VmName,CreationTime,Type,@{Name='Local';Expression={$backupFile.IsContentInternal}},@{Name='CapacityTier';Expression={$backupFile.IsContentExternal}},@{Name='ArchiveTier';Expression={$backupFile.IsContentFrozen}}
}
Code: Select all
$rps = Get-VBRBackup -Name 'Backup' | Get-VBRRestorePoint| Sort-Object -Property CreationTime
$storages = @()
foreach ($rp in $rps){
$storage = $rp.GetStorage()
$storages += $storage | select @{n='VMName';e={$rp.VmName}}, @{n='CreationTime';e={$storage.CreationTime}}, `
@{n='Type';e={$rp.Type}}, @{n='Local';e={$storage.IsContentInternal}}, `
@{n='CapacityTier';e={$storage.IsContentExternal}}, @{n='ArchiveTier';e={$storage.IsContentFrozen}}, @{n='IsCopied';e={$false}}
if ($storage.IsContentExternal -eq $false) {
try {
$shadowStorage = [Veeam.Backup.Core.CStorage]::GetShadowStorageByOriginalStorageId($storage.Id, $false)
$storages += $shadowStorage | select @{n='VMName';e={$rp.VmName}}, @{n='CreationTime';e={$shadowStorage.CreationTime}}, `
@{n='Type';e={$rp.Type}}, @{n='Local';e={$shadowStorage.IsContentInternal}}, `
@{n='CapacityTier';e={$shadowStorage.IsContentExternal}}, @{n='ArchiveTier';e={$shadowStorage.IsContentFrozen}}, `
@{n='IsCopied';e={$true}}
}
catch [System.Management.Automation.MethodInvocationException] {
continue
}
}
}
$storages | ft
Do you mean shadow copies on the local disks of the performance tier where backup files resides? Or shadow copies on the guest OS?What you can do with it is check whether local storages have shadow copies
Code: Select all
$restorepointall = Get-VBRBackup | Get-VBRRestorePoint| Sort-Object -Property CreationTime
$storages = @()
foreach ($restorepoint in $restorepointall){
$storage = $restorepoint.GetStorage()
$VMName = $restorepoint.VMName
$Type = $restorepoint.Type
$CreationTime = $storage.CreationTime
$IsLocal = $storage.IsContentInternal
$CapacityTier = $storage.IsContentExternal
$ArchiveTier = $storage.IsContentFrozen
$IsCopied = $false
if ($storage.IsContentExternal -eq $false) {
try {
$shadowStorage = [Veeam.Backup.Core.CStorage]::GetShadowStorageByOriginalStorageId($storage.Id, $false)
$CreationTime = $shadowStorage.CreationTime
$IsLocal = $shadowStorage.IsContentInternal
$CapacityTier = $shadowStorage.IsContentExternal
$ArchiveTier = $shadowStorage.IsContentFrozen
$IsCopied = $true
}
catch [System.Management.Automation.MethodInvocationException] {
continue
}
finally {
#$storageobj = [PSCustomObject]@{
[PSCustomObject]@{
VMName = $VMName
Type = $Type
CreationTime = $CreationTime
IsLocal = $IsLocal
CapacityTier = $CapacityTier
ArchiveTier = $ArchiveTier
IsCopied = $IsCopied
}
$storages += $storageobj
}
}
}
Users browsing this forum: No registered users and 30 guests