Video Screencast Help
Scheduled Maintenance: Symantec Connect is scheduled to be down Saturday, April 19 from 10am to 2pm Pacific Standard Time (GMT: 5pm to 9pm) for server migration and upgrade.
Please accept our apologies in advance for any inconvenience this might cause.


Created: 17 Jan 2013 • Updated: 20 Jan 2013 | 3 comments
bawright's picture
This issue has been solved. See solution.

Hi There

I'm running the below command. However it returns more than the last 12 hours.

Get-BEJobHistory -JobStatus Error -FromStartTime (Get-Date).AddHours(-12) | ft -auto

Any help with would be great?




Comments 3 CommentsJump to latest comment

pkh's picture

Have you tried this?

$a = (Get-Date).AddHours(-12)

Get-BEJobHistory -JobStatus Error -FromStartTime $a | ft -auto

If the above also does not work, try filtering it another way.

$a = (Get-Date).AddHours(-12)

Get-BEJobHistory -JobStatus Error | where-object {($_.StartTime > $a)} | ft -auto

bawright's picture

Both of these don't work. The first comes be the last couple of months of jobs and the second one I get the below error.


Cannot find drive. A drive with the name '01/20/2013 20' does not exist.
At line:3 char:65
+ Get-BEJobHistory -JobStatus Error | where-object {$_.StartTime > <<<<  $a} | ft -auto
    + CategoryInfo          : ObjectNotFound: (01/20/2013 20:String) [], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound
bawright's picture

However this works


$a = (Get-Date).AddHours(-12)
Get-BEJobHistory -JobStatus Error | where-object {$_.StartTime -gt $a} | ft -auto