Accessing Retention options using Powershell

PowerShell script exchange

Accessing Retention options using Powershell

Veeam Logoby AdrianHinton » Sat May 10, 2014 12:23 am

Hi all,

The variable $Jobs = Get-VBRJob and now contains all configured jobs on my server. I want to get at the GFS options on a BackupSync job, one of which happens to be the third element in the $Jobs variable. Below is how I have accessed this data and underneath are the returned properties:

$Jobs[2].Options.Options.RootNode.FirstChild

RecoveryPointObjectiveValue
RecoveryPointObjectiveUnit
SyncIntervalStartTime
RetentionPolicyType
SimpleRetentionRestorePoints
KeepGfsBackups
GFSRecentPoints
GFSMonthlyBackups
GFSWeeklyBackups
GFSQuarterlyBackups
GFSYearlyBackups
WeeklyBackupDayOfWeek
WeeklyBackupTime
MonthlyBackupCreationTime
QuarterlyBackupCreationTime
YearlyBackupCreationTime
EnableDeletedVmDataRetention
DeletedVmsDataRetentionPeriodDays
CompactMonthlyScheduleOptions
EnableCompactFull
CompactFullBackupScheduleKind
RecheckMonthlyScheduleOptions
EnableRecheck
RecheckScheduleKind
CompactFullBackupDays
RecheckDays

Could you tell me the alternative ways (if any) to get at these values?

Thank you.
AdrianHinton
Enthusiast
 
Posts: 71
Liked: 5 times
Joined: Mon Apr 07, 2014 10:00 am
Full Name: Adrian Hinton

Re: Accessing Retention options using Powershell

Veeam Logoby v.Eremin » Mon May 12, 2014 8:41 am 1 person likes this post

The information about GFS generation policy is also available under GetOptions().GenerationPolicy.

Code: Select all
$Job = Get-VBRJob -name "Name of your backup Copy Job"
$Options = $Job.GetOptions()
$Options.GenerationPolicy


Thanks.
v.Eremin
Veeam Software
 
Posts: 13558
Liked: 1006 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Check retention policy in powershell

Veeam Logoby ldasilva » Fri Jul 07, 2017 3:12 pm

Hi,

Can anyone help me out?

I'm trying to query the retention policy of backup copy jobs using powershell.

$Job = Get-VBRJob -name "jobname"
$Options = $Job.GetOptions()
$Options.GenerationPolicy


How can i use the command $options.GenerationPolicy to only show me the GFSyearlybackups

Thank you


GFSRecentPoints : 2
GFSWeeklyBackups : 4
GFSMonthlyBackups : 12
GFSQuarterlyBackups : 0
GFSYearlyBackups : 10
GFSIsReadEntireRestorePoint : False
WeeklyBackupDayOfWeek : Sunday
WeeklyBackupTime : 22:00:00
ldasilva
Novice
 
Posts: 5
Liked: never
Joined: Tue Apr 25, 2017 5:43 pm
Full Name: Lisandro da Silva


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests