I was looking into reporting immutability retention settings on repositories the other day, and using the native cmdlets gave inconsistent results such as Get-VBRBackupRepository returning IsImmutabilitySupported=true for Linux Hardened Repos, but false for S3 repos that have immutability enabled. Using the more specific command Get-VBRObjectStorageRepository correctly returned BackupImmutabilityEnabled=true and the Immutability Period.
However, for the Linux Hardened Repo, Get-VBRBackupRepository doesn't return the immutability period. The only consistent way I found of getting the ImmutabilityEnabled status with the retention period, was to use the DynamicMethod FindImmutabilitySettings() which correctly returned the information I was after in a single cmdlet.
Example:
Trying to use Get-VBRBackupRepository
Code: Select all
> Get-VBRBackupRepository | select Name,Type,IsImmutabilitySupported
Name Type IsImmutabilitySupported
---- ---- -----------------------
lab-m01-vbr02-local WinLocal False
lab-m01-vbr02-bdrive WinLocal False
wasabi-benthomas-veeam-test01 WasabiS3 False
lab-m01-vcr02 - mnt_veeam-xfs LinuxHardened True
Code: Select all
> Get-VBRObjectStorageRepository | Select Name,Type,BackupImmutabilityEnabled,ImmutabilityPeriod
Name Type BackupImmutabilityEnabled ImmutabilityPeriod
---- ---- ------------------------- ------------------
wasabi-benthomas-veeam-test01 AmazonS3Compatible True 7
Code: Select all
> Get-VBRBackupRepository | Select Name,Type,`
>> @{n='BackupImmutabilityEnabled';e={$_.FindImmutabilitySettings().IsEnabled}},`
>> @{n='ImmutabilityPeriod';e={$_.FindImmutabilitySettings().IntervalDays}}
Name Type BackupImmutabilityEnabled ImmutabilityPeriod
---- ---- ------------------------- ------------------
lab-m01-vbr02-local WinLocal
lab-m01-vbr02-bdrive WinLocal
wasabi-benthomas-veeam-test01 WasabiS3 True 7
lab-m01-vcr02 - mnt_veeam-xfs LinuxHardened True 7