I have pretty well got this licked but the property I am using for a backup copy end time is out by a varying amount. Usually only a minute or two compared to the GUI but I want to make sure that I am using an accurate property. If it is just that it is not capturing some clean up time then I am not worried but I don't want to get down the track somewhere and find it is out by a mile. Obviously the correct property would be best if anyone knows which one it is. I am using Get-VBRBackup and $_.findlastintimestorage().actualenddate. I have looked at about a dozen or so forum posts suggesting varying cmdlets but have had no luck with any of them. I am using PS 5.1.14409.1018 on 2012R2 with VBR Build 11.0.0.837 P20210525.
Can you tell me please which data in the UI you are trying to correlate the value of ActualEndTime property with? Is it the value you see in Date column when expanding Properties of a Backup and looking at Files window with a list of storages?
Hi Oleg,
I am using the start and finish times from the Action pane after selecting the backup copy job in 'Jobs', 'Backup Copy' then the copy job. This is without selecting the individual backup job in the lower left below the summary data. If I do the break up of each individual backup job copy still shows the last completed as out by a couple of minutes.
I am not 100% on the terminology, so I don't know if this is what you mean but if I open the copy job in a new window from 'Jobs', 'Backup Copy' and double click on the copy job from the top right pane it shows the same values as the first way I mentioned.
I duly reviewed your script, checked our .NET classes implementation and, to be honest, still can't figure out what ActualEndTime property in CStorage class stands for. My guess is that's the time when a storage is locked out from further modifications. But this value is nowhere near what you are after, I believe. Now, from what you are describing, you are actually looking for last session's start and end times. It is quite simple to get these for a common job, but for a backup copy job in immediate mode it might get a bit tricky since you need to obtain job workers first:
Thanks Oleg, your $worker[0] property triggered me to realise I was thinking in terms of the copy job instead of each copy job session. For copy jobs where there was only one backup job it worked fine but if there were multiple sources I was not enumerating all of the backup jobs that were copied. Now I have all of the finish times perfectly accurate. Plus using VBR-Job for both makes it faster.