Possible to assign tape in slot to mediapool?

PowerShell script exchange

Re: Possible to assign tape in slot to mediapool?

Veeam Logoby v.Eremin » Mon Aug 29, 2016 8:52 am

Do I need to add that

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

Re: Possible to assign tape in slot to mediapool?

Veeam Logoby BayanInv » Sun Sep 04, 2016 8:51 am

This is running me mad. Got another error:
Code: Select all
Error running pre-job script: The specified executable is not a valid application for this OS platform

Do I have to change the file extension to .bat as I used the .ps1 extension.
BayanInv
Influencer
 
Posts: 10
Liked: never
Joined: Sun Aug 07, 2016 9:54 am
Full Name: BayanINV

Re: Possible to assign tape in slot to mediapool?

Veeam Logoby v.Eremin » Mon Sep 05, 2016 1:04 pm

You can specify the following command as a pre-job activity:

Code: Select all
Powershell.exe -File C:\YourScript.ps1


The script itself should start with "Add-PSSnapin VeeamPSSnapin".

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

Re: Possible to assign tape in slot to mediapool?

Veeam Logoby BayanInv » Tue Sep 20, 2016 8:16 am

Thanks,
My pre-job script is now Working Fine. To summarize
Created a script with extension .ps1, and added "Add-PSSnapin VeeamPSSnapin"

Code: Select all
Add-PSSnapin VeeamPSSnapin
$free = Get-VBRTapeMediaPool -Name "Free"
$pool = Get-VBRTapeMediaPool -Name "Weekly"
$tape = Get-VBRTapeMedium -MediaPool $pool | where {$_.Location.SlotAddress -eq "5"}
Move-VBRTapeMedium -Medium $tape -MediaPool $free


At the Job's Advance Setting window - under Job-scripts
enabled Run the following script before the job:
Code: Select all
Powershell.exe -File C:\Weekly.ps1
BayanInv
Influencer
 
Posts: 10
Liked: never
Joined: Sun Aug 07, 2016 9:54 am
Full Name: BayanINV

Re: Possible to assign tape in slot to mediapool?

Veeam Logoby v.Eremin » Tue Sep 20, 2016 10:25 am

I've created previously a post describing different ways to use PowerShell scripts as a pre/post-job activity; the suggest approach is mentioned there as well.

Anyway, glad to hear that everything works as expected for you.

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

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests