PowerShell script exchange
Post Reply
SCOIT
Novice
Posts: 9
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Extraction of Active Full backup days

Post by SCOIT »

Hello,

I'm trying to get a report on the Active Full backup days for all of my jobs via PowerShell but can't seem to find the properties anywhere.
I've tried the commands below but they don't give this particular info:

Image

$(Get-VBRJob -Name "exchange").BackupTargetOptions

$(Get-VBRJob -Name "exchange").ScheduleOptions

Get-VBRJob -Name "exchange" | Get-VBRJobOptions

Thanks for any help!
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Extraction of Active Full backup days

Post by jhoughes » 2 people like this post

Here's what you're looking for, it exists between the backup storage & backup target option properties:

Code: Select all

$Job = Get-VBRJob -Name "exchange"
$Job.Options.BackupStorageOptions.EnableFullBackup
$Job.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayNumberInMonth
$Job.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayOfWeek
In case you are wanting to see the full view of the full backup schedule, run this:

Code: Select all

$Job.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
SCOIT
Novice
Posts: 9
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT »

Awesome thanks jhoughes that is exactly what I was looking for!

I saw the options property with Get-VBRJob | Get-Member but didn't realize you could keep stacking properties on top of each other like you did with .Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayNumberInMonth
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Extraction of Active Full backup days

Post by jhoughes »

Yes, there are some levels of options there.

If you install the PowerShellCookbook module from the PowerShell Gallery, you'll get an awesome tool with the 'Show-Object' cmdlet which will give you a tree view which you can navigate.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
SCOIT
Novice
Posts: 9
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT »

I'll take a look, thanks!

One more question. Is there any way to get the job name to display with the results of $Job.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions

As an example I ran this below which gives the day of week, day number in month and day of month:
$Job = Get-VBRJob
$Job.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions

What I'm trying to get is the above information for all jobs including the name of the jobs in another column, if that makes sense.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Extraction of Active Full backup days

Post by veremin » 1 person likes this post

Check this example:

Code: Select all

Asnp VeeamPSSnapin
Get-VBRJob -name "Backup Job 1"| Select @{N="Job Name";E={$_.Name}}, @{N="Day of week";E={$_.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.dayofweek}}, @{N="Day number in month";E={$_.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayNumberInMonth}}, @{N="Day of month";E={$_.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.dayofMonth}}, @{N="Months";E={$_.Options.BackupTargetOptions.FullBackupMonthlyScheduleOptions.months}} | Format-Table -AutoSize
Thanks!
SCOIT
Novice
Posts: 9
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT » 1 person likes this post

That worked, than you very much veremin!
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests