cancel
Showing results for 
Search instead for 
Did you mean: 

BEMCLI: Get last expected job start time

lufist
Level 3

Hello everybody,

i was wondering whether there's a easy method to get the last expected start time of a backup job. I found 

(Get-BEJob | select -First 1).Schedule

But with these information the last expected (!) start time has to be hardly calculated manually. 

I am looking for a easy parseable variable which can be used to determine wheter a job has successfully started at the last start time. 

Thanks in advance. 

 

4 REPLIES 4

pkh
Moderator
Moderator
   VIP    Certified
I am not as a are of any BEMCLI cmdlet which gives you the information that you want. The best way to is to check the job history using the Get_BEJobHistory cmdlet

BE_KirkFreiheit
Level 4
Employee

Hi lufist,

BEJob has a "NextStartDate" property -- it's a DateTime object, not a string -- so no parsing necessary.

We added formatting to many object types in BEMCLI so they look better in the console by default -- but this also hides many useful properties.  To see all of them, use "Format-List * -Force" like so:

Get-BEJob | Select -first 1 | Format-List * -Force

That will show you every possible property of a BEJob.

Hope that helps you out!

-Kirk out.

lufist
Level 3

Thank you very much. Is there also a property which gives the last expected start time? 

BE_KirkFreiheit
Level 4
Employee

No, there isn't a property for the last expected start time.  However, as pkh suggested, you may be able to get what you're looking for by examining the most recent job history related to the job you're trying to learn that info from:

$history = Get-BEJob "Job Name" | Get-BEJobHistory | Select -First 1

Here, the $history variable would have the latest job history object.  Perhaps its StartTime would help?