PowerShell script exchange
Post Reply
sfaits
Novice
Posts: 6
Liked: 2 times
Joined: Apr 07, 2017 7:08 pm
Full Name: William Croft
Contact:

Getting Job Schedules, Start, last run, and next run

Post by sfaits »

I am using Get-VBRJob and parsing out the ScheduleOptions to get a variety of data on the jobs but I am noticing that the NextRun, LatestRunLocal, and StartDateLocalTime all return an incorrect date but do give the correct time.
It does this for all the jobs I check.
I also get the same results with Get-VBRJobScheduleOptions.

When I log into the Database schema and check the View dbo.JobsView the XML stored in schedules field has all the correct data.

Any idea why those cmdlets would be returning bad dates?

Thanks!

Natalia Lupacheva
Veeam Software
Posts: 229
Liked: 59 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by Natalia Lupacheva »

Hi William,

Could you please clarify what's exactly incorrect?
If we are talking about date format, this thread might help you to solve this issue (you can take a look at the workaround for date formatting).
If it's not about the date formatting, please give us some details.

Thanks!

sfaits
Novice
Posts: 6
Liked: 2 times
Joined: Apr 07, 2017 7:08 pm
Full Name: William Croft
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by sfaits »

Here is some test code I have been using plus the results returned.

======================

Code: Select all

$jobName = "backupjob1"
$temp = Get-VBRJob -name $jobName
$temp.ScheduleOptions
<...removed lines....>
StartDateTimeLocal                    : 4/2/2020 11:55:00 PM
EndDateTimeSpecified                  : False
EndDateTimeLocal                      : 4/4/2020 8:01:55 AM
<...removed lines....>
NextRun                               : 04/23/2020 23:55:00
LatestRunLocal                        : 4/22/2020 11:55:13 PM
<...removed lines....>
=======================

I would expect the NextRun to be 8/24/2020 23:55:00 as the job runs daily
and the LastRunLocal to 8/23/2020 23:55:00 since that is when it last ran.

Natalia Lupacheva
Veeam Software
Posts: 229
Liked: 59 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by Natalia Lupacheva »

Hi William,

sorry for late response.
So there's not a formatting issue and the dates you get via Powershell commands don't even match the information you see in VBR, right?
In that case it's better to open a Support ticket, because it doesn't seem to be some known issue.

Thanks!

sfaits
Novice
Posts: 6
Liked: 2 times
Joined: Apr 07, 2017 7:08 pm
Full Name: William Croft
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by sfaits »

Thank you Natalia I will get a case opened. :)

sfaits
Novice
Posts: 6
Liked: 2 times
Joined: Apr 07, 2017 7:08 pm
Full Name: William Croft
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by sfaits » 2 people like this post

Got a quick response that this is a known issue and that they are working on getting a fix scheduled for v11 or possibly a hotfix, depending.
As a work around they suggest using the LatestRun data within the LatestRunLocal property of Veeam.Backup.Core.CBackupJob

Natalia Lupacheva
Veeam Software
Posts: 229
Liked: 59 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Getting Job Schedules, Start, last run, and next run

Post by Natalia Lupacheva »

Hi William,

Thank you for the follow-up! Appreciate it.

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests