PowerShell script exchange
Post Reply
extremesanity
Influencer
Posts: 14
Liked: 6 times
Joined: Jul 31, 2014 3:47 pm
Full Name: Lucas
Contact:

Monthly report on Active Fulls

Post by extremesanity »

I would like to verify via report that my Active Fulls are running every month.

I can run something like this and add additional constraints to get what I want, but all it returns is Type = "Full". How can I tell when a restore point is an Active Full and not a Synthetic Full?

Get-VBRRestorePoint -backup testjob1 -name test22 | Where {$_.type -eq "Full"}
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Monthly report on Active Fulls

Post by veremin »

There is a script that checks whether the last job session was synthetic full backup. You can take this approach as an example and propagate it further. Find monthly worth session, checks whether it was a full backup one, and verify whether or not the "Synthetic" string is there. Thanks.
extremesanity
Influencer
Posts: 14
Liked: 6 times
Joined: Jul 31, 2014 3:47 pm
Full Name: Lucas
Contact:

Re: Monthly report on Active Fulls

Post by extremesanity »

So I guess what is confusing me is how I grab the last month worth of sessions so I can loop through them and check if the log contains or doesn't contain certain text.

It appears the built in functions only account for grabbing the last session?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Monthly report on Active Fulls

Post by veremin »

You can use the following script in order to grad 1 month old full backup sessions:

Code: Select all

$1MonthOld = (Get-Date).AddMonths(-1)
$Sessions = Get-VBRBackupSession | where {($_.Jobname -eq "Backup Job 1") -and ($_.CreationTime.date -eq $1MonthOld.Date) -and ($_.IsFullMode -eq $True)} 
Thanks.
extremesanity
Influencer
Posts: 14
Liked: 6 times
Joined: Jul 31, 2014 3:47 pm
Full Name: Lucas
Contact:

Re: Monthly report on Active Fulls

Post by extremesanity »

That is what I need thank you.

For others reference, IsFullMode = True will only pull Active Fulls and not Synthetic Fulls (as I wanted). You can verify this manually by checking the history. An Active Full session will have (full) next to the session name, and will NOT have any reference to "full" in the backup session log. A Synthetic Full will NOT have (full) in the session name and WILL have "synthetic full" in the backup session log.

What I ended up with:

Code: Select all

$1MonthOld = (Get-Date).AddMonths(-1)
$today = (Get-Date)
$results = Get-VBRBackupSession | where {($_.Jobname -eq "jobname") -and ($_.CreationTime.date -ge $1MonthOld.Date) -and ($_CreationTime.date -le $today) -and ($_.IsFullMode -eq $True)} 
write-output $results
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Monthly report on Active Fulls

Post by veremin »

Glad to hear my input was helpful. Feel free to reach us, if other questions arise. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests