PowerShell script exchange
hgrams
Service Provider
Posts: 78 Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:
Post
by hgrams » Jan 09, 2015 8:54 am
this post
Hi, at a given point in time I check the environment, if there are still running Copy-To-Tape jobs, e.g. because no tape was inserted. In Veeam 7, I do it on this way:
Code: Select all
Get-VBRTapeJob | ? {$_.GetLastState() -like "WaitingTape"}
With Veeam 8, it doesn't work anymore. Neither the property "GetLastState" seems to be existing nor another property hold such information. How can I do that with Veeam 8?
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Jan 13, 2015 9:18 am
this post
Just out of curiosity - doesn't
the mail notification for this situation added in first patch remove the need of using PS code? Thanks.
hgrams
Service Provider
Posts: 78 Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:
Post
by hgrams » Jan 15, 2015 11:52 am
this post
This is not the wanted situation. I don't need a notification. The customer should insert a tape in the evening. After that time nobody is there to react on a notification. Next day at 09a.m. should run a script to determine if any active Copy-to-tape jobs are still running. If yes, abort them.
How can I do this with Veeam 8?
hgrams
Service Provider
Posts: 78 Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:
Post
by hgrams » Jan 15, 2015 12:25 pm
this post
Hi Vladimir
At the moment I have 2 running jobs. The Job "Last-VBK-Files Tu - Fr" has the status "WaitingTape" in the Veeam Console.
When I check tho job via PS, then I get this:
Code: Select all
PS C:\Users\Administrator.HA-HO> $TapeJob = Get-VBRTapeJob -name "Last-VBK-Files Tu - Fr"
PS C:\Users\Administrator.HA-HO> $TapeJob
FullBackupPolicy : Daily
IncrementalBackupPolicy : Daily
Object : {D:\Copy2Tape-Links}
UseVss : False
EjectCurrentMedium : False
ExportCurrentMediaSet : False
ExportDays : {Sunday, Monday, Tuesday, Wednesday...}
FullBackupMediaPool : Day
IncrementalBackupMediaPool : Day
UseHardwareCompression : False
NextRun :
Target : Day
Type : FileToTape
LastResult : Success
LastState : Stopped
Id : 765d97c3-d7c1-4eeb-bfe1-cca34ee5edaa
Name : Last-VBK-Files Tu - Fr
Description : Copy last Veeam Full-Backup-Files to tape (Tuesday to Friday)
"LastState" reports "Stopped". Where stores Veeam the status "WaitingTape", which is diplayed in Veeam console?
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Jan 15, 2015 1:12 pm
this post
Hmm, looks like a bug. I've notified dev.team about that already. For now you can use the following workaround:
Code: Select all
$Job = Get-VBRTapeJob -name "Last-VBK-Files Tu - Fr"
[Veeam.Backup.Core.CBackupJob]::GetLastState($Job.id)
Thanks.
hgrams
Service Provider
Posts: 78 Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:
Post
by hgrams » Jan 15, 2015 2:42 pm
this post
Thanks, that works
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Jan 15, 2015 2:53 pm
this post
You're welcome. Feel free to reach us, if additional clarification is needed. Thanks.
bartvdw
Novice
Posts: 3 Liked: never
Joined: Feb 09, 2013 12:31 pm
Full Name: Bart Van den Wyngaert
Contact:
Post
by bartvdw » Apr 09, 2015 10:57 am
this post
It seems this is still the case after Patch 1 , any news from Dev ?
Thanks
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Apr 09, 2015 12:06 pm
this post
Patch#1 had been released before we found that bug. If everything goes as expected, it should be addressed in Update 2.
Anyway, feel free to use the provided workaround.
Thanks.
bartvdw
Novice
Posts: 3 Liked: never
Joined: Feb 09, 2013 12:31 pm
Full Name: Bart Van den Wyngaert
Contact:
Post
by bartvdw » Apr 13, 2015 7:18 am
this post
Thanks for the feedback! Is there an ETA on Patch 2 ? (just asking)
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Apr 13, 2015 9:13 am
this post
Yep, it's expected to be released by the end of this month.
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » Apr 29, 2015 11:18 am
this post
Just to let you know. Update 2 is now
generally available . Both laststate and lastresult parameters should reflect correct values now. Thanks.
hgrams
Service Provider
Posts: 78 Liked: 10 times
Joined: Jan 27, 2014 4:28 pm
Full Name: Harald Grams
Contact:
Post
by hgrams » May 04, 2015 10:07 am
this post
I tested it with Update 2, it works like expected
veremin
Product Manager
Posts: 20735 Liked: 2403 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Post
by veremin » May 06, 2015 2:27 pm
this post
You're right both lastresult and laststate parameters are now reflecting proper values. Thank you for confirming that; appreciated.
Users browsing this forum: Semrush [Bot] and 25 guests