PowerShell script exchange
Post Reply
skaanbarry
Influencer
Posts: 10
Liked: never
Joined: Mar 22, 2022 8:07 am
Contact:

Get-VBRRestoreSession for last 30 days

Post by skaanbarry »

Hello guys,

For my backup reporting I would like to run a report at the end of each month to see how many restores have been done.

Is there a way to give extra parameters to Get-VBRRestoreSession to only get the restores of the last 30 days? Can't find much here: https://helpcenter.veeam.com/docs/backu ... ml?ver=120

I'm somewhat of a powershell noob.

Kind regards
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get-VBRRestoreSession for last 30 days

Post by Mildur » 1 person likes this post

Hi Skaanbarry

We have the start time property (CreationTime) when you run this command. It's a datetime property.
Datetime can be filtered with general PowerShell commands:

Code: Select all

Get-VBRRestoreSession | Where-Object {$_.CreationTime -gt (Get-Date).AddDays(-30)} | Sort-Object CreationTime
Best,
Fabian
Product Management Analyst @ Veeam Software
skaanbarry
Influencer
Posts: 10
Liked: never
Joined: Mar 22, 2022 8:07 am
Contact:

Re: Get-VBRRestoreSession for last 30 days

Post by skaanbarry »

@Mildur , thank you so much! That worked like a charm.

Much appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests