PowerShell script exchange
Post Reply
benthomas
Veeam Vanguard
Posts: 39
Liked: 11 times
Joined: Apr 22, 2013 2:29 am
Full Name: Ben Thomas
Location: New Zealand
Contact:

Auditing Repo Immutability Settings

Post by benthomas »

Looking over @oleg.feoktistov recent post on Powershell FAQs in regards to the use of unsupported methods, I wanted to follow up with a scenario I ran across last week that could only be solved with an unsupported method.

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
Switching to Get-VBRObjectStorageRepository

Code: Select all

> Get-VBRObjectStorageRepository | Select Name,Type,BackupImmutabilityEnabled,ImmutabilityPeriod

Name                                        Type BackupImmutabilityEnabled ImmutabilityPeriod
----                                        ---- ------------------------- ------------------
wasabi-benthomas-veeam-test01 AmazonS3Compatible                      True                  7
Using the FindImmutabilitySettings() Method

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
Is there a native cmdlet I just can't find specifically for querying the immutability of Veeam Backup Repos?
Ben Thomas | Solutions Advisor | Veeam Vanguard 2023 | VMCE2022 | Microsoft MVP 2018-2023 | BCThomas.com
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Auditing Repo Immutability Settings

Post by oleg.feoktistov » 2 people like this post

Hi Ben,

Yes, that's exactly what I meant in Powershell FAQs. We don't have a native cmdlet for getting repositories immutability settings, unfortunately, but we have plans to add cmdlets for repositories that operate with official powershell types and don't have the problems Get-VBRBackupRepository has.

Best regards,
Oleg
benthomas
Veeam Vanguard
Posts: 39
Liked: 11 times
Joined: Apr 22, 2013 2:29 am
Full Name: Ben Thomas
Location: New Zealand
Contact:

Re: Auditing Repo Immutability Settings

Post by benthomas »

Thanks Oleg, look forward to this and happy to test any early cmdlets for feedback
Ben Thomas | Solutions Advisor | Veeam Vanguard 2023 | VMCE2022 | Microsoft MVP 2018-2023 | BCThomas.com
albertwt
Veteran
Posts: 880
Liked: 47 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: Auditing Repo Immutability Settings

Post by albertwt »

oleg.feoktistov wrote: Aug 15, 2023 2:08 pm Hi Ben,

Yes, that's exactly what I meant in Powershell FAQs. We don't have a native cmdlet for getting repositories immutability settings, unfortunately, but we have plans to add cmdlets for repositories that operate with official powershell types and don't have the problems Get-VBRBackupRepository has.

Best regards,
Oleg
Thank you for the confirmation @Oleg,
Let us know when it is ready for us to test.
--
/* Veeam software enthusiast user & supporter ! */
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests