powershell script for backup time

PowerShell script exchange

powershell script for backup time

Veeam Logoby ThinkGrid » Tue Apr 08, 2014 2:28 pm

Hi guys

Is there any powershell script I can apply that would tell me if a Job has been running for more than 12 hours. I just want to be alerted rather than stop the job

Posts: 55
Liked: 2 times
Joined: Mon Jul 11, 2011 10:18 am

Re: powershell script for backup time

Veeam Logoby v.Eremin » Tue Apr 08, 2014 2:35 pm 1 person likes this post

Have you considered Veeam ONE alerting system for that purpose; might be exactly what you're looking for? Thanks.
Veeam Software
Posts: 14019
Liked: 1051 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: powershell script for backup time

Veeam Logoby ehrnst » Wed Apr 09, 2014 11:55 am

This could probably get you going, just change the "totalhours" to be greather than. I did not have any jobs that have ben running for more than 20 minutes

Code: Select all
Get-VBRJob | Where {($_.GetLastState() -eq "Working") -and (((Get-Date) - $_.FindLastSession().CreationTime).TotalHours -lt '1')} | Select name, @{N="Start Time";E={($_.FindLastSession().CreationTime)}}, @{N="Status";E={($_.GetLastState())}}
Posts: 35
Liked: 1 time
Joined: Fri Jan 31, 2014 8:24 am
Full Name: Martin Ehrnst

Return to PowerShell

Who is online

Users browsing this forum: ssimakov and 1 guest