PowerShell script exchange
Post Reply
rchugha
Lurker
Posts: 1
Liked: never
Joined: Dec 05, 2014 4:26 am
Full Name: Ricky Chugha
Contact:

Get-VBRTapeJob

Post by rchugha » 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

veremin
Product Manager
Posts: 16901
Liked: 1438 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRTapeJob

Post by veremin » 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.

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

Re: Get-VBRTapeJob

Post by rccrwwv » 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

justind
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 09, 2014 4:20 am
Location: Australia
Contact:

Re: Get-VBRTapeJob

Post by justind » 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

nefes
Veeam Software
Posts: 628
Liked: 156 times
Joined: Dec 10, 2012 8:44 am
Full Name: Nikita Efes
Contact:

Re: Get-VBRTapeJob

Post by nefes » Dec 10, 2014 2:56 pm

Have you tried using wildcard characters in -Name parameter (especially *)?

veremin
Product Manager
Posts: 16901
Liked: 1438 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRTapeJob

Post by veremin » 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.

justind
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 09, 2014 4:20 am
Location: Australia
Contact:

Re: Get-VBRTapeJob

Post by justind » 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.

veremin
Product Manager
Posts: 16901
Liked: 1438 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRTapeJob

Post by veremin » 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.

veremin
Product Manager
Posts: 16901
Liked: 1438 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRTapeJob

Post by veremin » Dec 11, 2014 10:52 pm

This problem will be addressed in the first patch. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests