PowerShell script exchange
Locked
andrewfox68
Enthusiast
Posts: 33
Liked: 2 times
Joined: Oct 29, 2016 10:13 pm
Full Name: Andrew Fox
Contact:

Powershell script to change tape media pools

Post by andrewfox68 »

Hello

I have a Powershell script that runs each week that changes the Media Pool for the Tape jobs.

I have noticed that sometimes after the script runs the "Next Run" times changes to []

This doesn't always happen and I have checked everything through.

I now believe that I may have an answer...

If the tape job's Last Result was a Success then the "Next Run" time is not amended, however, if the tape job's Last Result was Failed then the script changes "Next Run" time to []

Is this a known issue?

Regards

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

Re: Powershell script to change tape media pools

Post by veremin »

What product version are you using? Can you post your script here? Thanks.
andrewfox68
Enthusiast
Posts: 33
Liked: 2 times
Joined: Oct 29, 2016 10:13 pm
Full Name: Andrew Fox
Contact:

Re: Powershell script to change tape media pools

Post by andrewfox68 »

Hello

We are using 9.5.0.1038

The script is:

Code: Select all

asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue
Set-VBRBackupToTapeJob -Job "Backup to Tape 01" -FullBackupMediaPool "Weekly Media Pool ER-T50e-02-LTO7" -IncrementalBackupMediaPool "Weekly Media Pool ER-T50e-02-LTO7" -AlwaysCopyFromLatestFull
Set-VBRBackupToTapeJob -Job "Backup to Tape 02" -FullBackupMediaPool "Weekly Media Pool AW-T50e-02-LTO7" -IncrementalBackupMediaPool "Weekly Media Pool AW-T50e-02-LTO7" -AlwaysCopyFromLatestFull
Just to confirm that it happened again this week, a job failed last week and now has a Next Run time of 'After []'. The job that ran successfully has the correct Next Run time.

Thanks

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

Re: Powershell script to change tape media pools

Post by veremin »

What happens if you assign media pool to a variable first and then pass it to corresponding parameter, instead of referencing its name?

Code: Select all

$FullBackupMediaPool = Get-VBRTapeMediaPool -name "Weekly Media Pool ER-T50e-02-LTO7" 
Set-VBRBackupToTapeJob -Job "Backup to Tape 01" -FullBackupMediaPool $FullBackupMediaPool ...
Thanks.
Locked

Who is online

Users browsing this forum: No registered users and 27 guests