PowerShell script exchange
Post Reply
tom.bazan
Novice
Posts: 4
Liked: never
Joined: Apr 22, 2025 9:52 am
Full Name: Tom Bazan
Contact:

Powershell script showing all Veeam backup files in Azure

Post by tom.bazan »

Is it possible to run a Powershell script showing a breakdown of all Veeam backup files in an Azure repository showing the following properties:

Source
Date
Differentiated by full/incremental
Immutability Expiration

Ideally would like that exported into a CSV.
david.domask
Veeam Software
Posts: 3010
Liked: 697 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Powershell script showing all Veeam backup files in Azure

Post by david.domask »

Hi tom.bazan,

This information is recorded on COib objects returned by Get-VBRRestorePoint in v13. An example script:

Code: Select all

$repo = Get-VBRBackupRepository -Name "dd-azure-immut" #replace with your immutable repository name
$backupsInRepo = Get-VBRBackup | Where-Object {$_.RepositoryId -eq $repo.id}
$reportBackups = @()
Foreach($b in $backupsInRepo){
	$restorePoints = Get-VBRRestorePoint -Backup $b | Sort -Property ObjectID, CreationTime 
	$jobSourceType = $b.TypeToString
	Foreach($r in $restorePoints){
		If($r.IsFull){$type = "Full"} else {$type = "Increment"}
		$immutableUntilUTC = $r.ImmutableTillUtc
		$data = [PSCustomObject]@{
			BackupType = $jobSourceType
			WorkloadName = $r.name
			RestorePointId = $r.id
			Type = $type
			CreationTimeUTC = $r.CreationTime.ToUniversalTime()
			ImmutableTillUtc = $immutableUntilUTC
			}
		$reportBackups += $data
		Remove-Variable data
		}
}
You can then export $reportBackups via Export-Csv.

Regrettably, v12 and earlier do not record the immutable information anymore in a reliable way so above script is for v13 and newer only.

Example output of above:

Code: Select all

PS C:\> $reportBackups

BackupType       : VMware Backup
WorkloadName     : dd-tinyvm2_restored_em-test
RestorePointId   : 001a793a-ba9f-4e13-b246-e9c7e5c7fcde
Type             : Full
CreationTimeUTC  : 2025-10-02 8:57:00
ImmutableTillUtc : 2025-11-11 8:56:10

BackupType       : VMware Backup
WorkloadName     : dd-tinyvm2_restored_em-test
RestorePointId   : c0f93ddd-4fae-4ca7-8b3e-d841d6c0b028
Type             : Increment
CreationTimeUTC  : 2025-10-02 9:03:52
ImmutableTillUtc : 2025-11-11 8:56:10

BackupType       : VMware Backup
WorkloadName     : dd-tinyvm_restored
RestorePointId   : ea571cc7-9e87-4ad5-b330-9f882e1d1ee3
Type             : Full
CreationTimeUTC  : 2025-10-02 8:57:00
ImmutableTillUtc : 2025-11-11 8:56:10

BackupType       : VMware Backup
WorkloadName     : dd-tinyvm_restored
RestorePointId   : c4274980-ba0a-4b5a-865e-a51bd8d02e4c
Type             : Increment
CreationTimeUTC  : 2025-10-02 9:03:52
ImmutableTillUtc : 2025-11-11 8:56:10
David Domask | Product Management: Principal Analyst
tom.bazan
Novice
Posts: 4
Liked: never
Joined: Apr 22, 2025 9:52 am
Full Name: Tom Bazan
Contact:

Re: Powershell script showing all Veeam backup files in Azure

Post by tom.bazan »

Many thanks for this David. I am on version 12.3.2.3617 at present, so will get Veeam upgraded to version 13 and then try this script out.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests