PowerShell script exchange
Post Reply
Suryanarayanan
Influencer
Posts: 17
Liked: 3 times
Joined: Jul 09, 2021 12:42 pm
Full Name: Suryanarayanan
Location: Bangalore India
Contact:

Script to fetch client's backup details for the last 24 hours

Post by Suryanarayanan »

Hi All,

I would like to fetch the last 24 hours backup status of each and every client with the details "Client_name, Job_name, Status, Start_time, End_time"


Client_name, Job_name, Status data are fetched using the below script

$vbrsessions = Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-24)}
foreach ($session in $vbrsessions) {$session.gettasksessions()| Select Name, Jobname, Status, }

How can I get the Start time and End time of each client?

Thanks in advance
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Script to fetch client's backup details for the last 24 hours

Post by Natalia Lupacheva » 1 person likes this post

Hi Suryanarayanan,

You can try with the following parameters:

Code: Select all

foreach ($session in $vbrsessions) {$session.gettasksessions()| Select Name, Jobname, Status, @{n='StartTimeLocal';e={$_.Progress.StartTimeLocal}}, @{n='EndTimeLocal';e={$_.Progress.StopTimeLocal}}} 


Thanks!
Suryanarayanan
Influencer
Posts: 17
Liked: 3 times
Joined: Jul 09, 2021 12:42 pm
Full Name: Suryanarayanan
Location: Bangalore India
Contact:

Re: Script to fetch client's backup details for the last 24 hours

Post by Suryanarayanan »

Hi Natalia,

Thanks for your prompt response. It solves my query :)
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Script to fetch client's backup details for the last 24 hours

Post by Natalia Lupacheva » 1 person likes this post

Glad to hear that!
Don't hesitate to ask if you have any further questions.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests