Get-VBRTapeJob

PowerShell script exchange

Get-VBRTapeJob

Veeam Logoby rchugha » Fri Dec 05, 2014 4:30 am

HI Guys,

i have powershell script which helps me to enable and disable Tape job based on date

Example:

i have 3 tape jobs: 1)Daily 2)weekly 3) Monthly and my powershell script enable or disable them based on date (if it is between Mon to Thursday ) it will enable Daily job and disable weekly and monthly

i was using cmd: Get-VBRTapeJob which you to get Tape job name since version 8 it does not work.

can any one assist me?

getting below error:
+ Get-VBRTapeJob | where {$_.name -eq "Tape Job - Weekly"}| Enable-VBRJob
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VBRTapeJob], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,Veeam.Backup.PowerShell.Cmdlets.GetVBRTapeJob

thanks
rchugha
Lurker
 
Posts: 1
Liked: never
Joined: Fri Dec 05, 2014 4:26 am
Full Name: Ricky Chugha

Re: Get-VBRTapeJob

Veeam Logoby v.Eremin » Fri Dec 05, 2014 8:50 am

Hi, Ricky,

I've just checked and this example seems to have worked in my case:

Code: Select all
Get-VBRTapeJob -Name "Name of your tape job" | Enable-VBRJob


Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRTapeJob

Veeam Logoby rccrwwv » Mon Dec 08, 2014 8:30 pm

Hello guys,

Not sure if anyone else has seen any issues with this cmdlet but I'm also getting an error message while trying to use get-vbrtapejob in version 8. I'm new to VBR Powershell but I believe this simple command should work just like get-vbrjob.

PS C:\scripts\vbr> get-vbrjob

Job Name Type State Last Result Description
-------- ---- ----- ----------- -----------
Prod Backup for Utilit... VMware Backup Stopped Success Created by SMC-AD\rlc at 10/16/2014 12:20:34 PM.
Prod Backup for Tier 1... VMware Backup Stopped Success Created by SMC-AD\rlc at 9/26/2014 4:22:11 PM.


PS C:\scripts\vbr> get-vbrtapejob
Get-VBRTapeJob : Value cannot be null.
Parameter name: incrementalBackupMediaPool
At line:1 char:15
+ get-vbrtapejob <<<<
+ CategoryInfo : NotSpecified: (:) [Get-VBRTapeJob], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,Veeam.Backup.PowerShell.Cmdlets.GetVBRTapeJob

PS C:\scripts\vbr>


Thanks
rccrwwv
Lurker
 
Posts: 1
Liked: never
Joined: Mon Dec 08, 2014 8:04 pm
Full Name: Ronnie Crowder

Re: Get-VBRTapeJob

Veeam Logoby justind » Wed Dec 10, 2014 12:24 pm

I too have experienced this issue since upgrading to v8.

Upon investigation I have found the following behaviour:

Fails:
Get-VBRTapeJob | where {$_.name -eq "Name of your tape job"}| Enable-VBRJob

Works ok:
Get-VBRTapeJob -Name "Name of your tape job" | Enable-VBRJob

Unfortunately this means that using a wildcard job name doesn't work anymore
justind
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Sun Nov 09, 2014 4:20 am
Location: Australia

Re: Get-VBRTapeJob

Veeam Logoby nefes » Wed Dec 10, 2014 2:56 pm

Have you tried using wildcard characters in -Name parameter (especially *)?
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Get-VBRTapeJob

Veeam Logoby v.Eremin » Wed Dec 10, 2014 5:35 pm

Also, I'm wondering whether your issue is exactly the same as the one described by previous author. Did you get "Value cannot be null" error while trying to use where portion? Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRTapeJob

Veeam Logoby justind » Wed Dec 10, 2014 10:35 pm

That is correct. If I use the where function I get the "ArgumentNullException" regardless of whether I use the -eq or -like operator.
justind
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Sun Nov 09, 2014 4:20 am
Location: Australia

Re: Get-VBRTapeJob

Veeam Logoby v.Eremin » Thu Dec 11, 2014 9:30 pm

As I'm currently out of the office, I've passed this information to dev team. Let's wait and see whether they'll be able to confirm that. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRTapeJob

Veeam Logoby v.Eremin » Thu Dec 11, 2014 10:52 pm

This problem will be addressed in the first patch. Thanks.
v.Eremin
Veeam Software
 
Posts: 13296
Liked: 974 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests