Get-VBRJob getlaststate method

PowerShell script exchange

Get-VBRJob getlaststate method

Veeam Logoby pizzim13 » Mon Oct 24, 2011 7:46 pm

Are there states other than "Working" and Stopped" for a backup job when using Get-VBRJob's getlaststate method?
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Get-VBRJob getlaststate method

Veeam Logoby ThomasMc » Mon Oct 24, 2011 8:11 pm

Starting->Working->Stopping->Stopped is the ones I've seen
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get-VBRJob getlaststate method

Veeam Logoby pizzim13 » Mon Oct 24, 2011 8:41 pm

I am looking for the ones you don't normally see (if they even exist). There could have been an "Initializing" state that came and went before you ran get-vbrjob or there could be a set of errors states.
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Get-VBRJob getlaststate method

Veeam Logoby ThomasMc » Mon Oct 24, 2011 9:04 pm

I kicked off the job from powershell and right after that stuck it in a loop

Code: Select all
$a = Get-VBRJob | ?{$_.Name -eq "JobName" }

do {
   Add-Content "c:\output.txt" $a.GetLastState()
} while ( $a.GetLastState() -ne "Stopped" )


http://dl.dropbox.com/u/4304771/state.txt

if there are any more then they must be hard to catch as you can see by my state.txt
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get-VBRJob getlaststate method

Veeam Logoby Sethbartlett » Tue Oct 25, 2011 1:41 pm

As always Peter :D

Code: Select all
public enum EState
    {
      Stopped = -1,
      Starting = 3,
      Stopping = 4,
      Working = 5,
      Pausing = 6,
      Resuming = 7,
    }
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Get-VBRJob getlaststate method

Veeam Logoby ThomasMc » Tue Oct 25, 2011 2:08 pm

So are you going to tell us how to pause the jobs then :D
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get-VBRJob getlaststate method

Veeam Logoby Gostev » Tue Oct 25, 2011 2:22 pm

Needless to say I am surprised myself :)
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Get-VBRJob getlaststate method

Veeam Logoby Sethbartlett » Tue Oct 25, 2011 2:31 pm

Probably placed in there for possibilities, but pausing would just be all sorts of bad with snapshots :D
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests