PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Get-VBRBackupCopyJob deleted items

Post by matteu »

Hello,

How to get the retention for deleted item with backup copy job with Get-VBRBackupCopyJob ?
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRBackupCopyJob deleted items

Post by oleg.feoktistov »

Currently there is no way to do it. We have a requirement to add it in one of the next product versions. As a workaround, you can use Get-VBRJob cmdlet:

Code: Select all

$job = Get-VBRJob -Name "Backup Copy Job 1"
$job.GenerationPolicy.EnableDeletedVmDataRetention
$job.GenerationPolicy.DeletedVmsDataRetentionPeriodDays
Best regards,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get-VBRBackupCopyJob deleted items

Post by matteu »

Thanks for your answer.

I'm sorry but I don't have Generationpolicy property on $job
Are you sure the cmdlet is the correct one ?

I did it this way with the older cmdlet :

$element = Get-VBRJob -name "xxxx"

Code: Select all

if($element.BackupStorageOptions.EnableDeletedVmDataRetention -eq $true) {$element.BackupStorageOptions.RetainDays} else {"<N/A>"}
I'm not sure it worked but I'm sure on V12, values are not updated because I check it with GUI and set it on 30 days and with get-vbrjob I don't see it's enabled and I don't seen 30 days

PS : Ok I find what you mentioned here :

$job = Get-VBRJob -Name "Backup Copy Job 1"
$job.Options.GenerationPolicy.EnableDeletedVmDataRetention
$job.Options.GenerationPolicy.DeletedVmsDataRetentionPeriodDays
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests