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

Extraction of Active Full backup days

Post by SCOIT » Aug 09, 2019 2:16 pm

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 Software
Posts: 91
Liked: 21 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Extraction of Active Full backup days

Post by jhoughes » Aug 09, 2019 2:40 pm 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 | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

SCOIT
Novice
Posts: 4
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT » Aug 09, 2019 4:56 pm

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 Software
Posts: 91
Liked: 21 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Austin, TX
Contact:

Re: Extraction of Active Full backup days

Post by jhoughes » Aug 09, 2019 7:15 pm

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 | @AustinVMUG & @ATXPowerShell leader | vExpert | Cisco Champion | Tech Field Day Delegate | VCP 4/5/6 | VCP6-NV | VMware/Cisco UCS/Powershell/VEEAM Enthusiast

SCOIT
Novice
Posts: 4
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT » Aug 12, 2019 7:14 pm

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: 16675
Liked: 1392 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Extraction of Active Full backup days

Post by veremin » Aug 12, 2019 7:40 pm 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: 4
Liked: 1 time
Joined: Aug 09, 2019 2:03 pm
Contact:

Re: Extraction of Active Full backup days

Post by SCOIT » Aug 13, 2019 6:21 pm 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 6 guests