PowerShell script exchange
Post Reply
tehinternet
Enthusiast
Posts: 32
Liked: 2 times
Joined: Jul 18, 2018 1:04 pm
Full Name: Mike

How to disable/enable tape job?

Post by tehinternet »

I run a monthly files to tape job. But when this is scheduled to run, I need to disable my weekly file to tape jobs for the week and enable the monthly job. Then after the monthly job runs I need to disable it and re-enable the weekly job. I understand scripting some powershell could be a solution to do this. I am trying to accomplish via PowerShell the same thing as R.clicking on a job in the B&R Console and selecting 'Disable' (or again to 'Enable').

I found how to enable this job:
PS C:\Users\admin> $options = New-VBRFileToTapeBackupPolicy -Enabled
PS C:\Users\admin> get-vbrtapejob -name "Non-Veeam Backups to Tape - Monthly" | Set-VBRFileToTapeJob -FullBackupPolicy $options

What I can't seem to figure out though is how to do the opposite? How can I disable this job via power shell?

I've tried these which don't work:
$options = New-VBRFileToTapeBackupPolicy -Enabled false
$options = New-VBRFileToTapeBackupPolicy -Disabled

I am at loss on how to get disabling to work.

Also, a side question/concern I have is with the way I'm going about this, is creating a New-VBRFileToTapeBackupPolicy to enable/disable the policy inadvertently passing the tape job other schedule info (frequency/time/date) and altering my job in that way aside from the simple enable/disable which I'm trying to do? How can I enable/disable this job in PowerShell without altering anything else in the job?

Thanks.
tehinternet
Enthusiast
Posts: 32
Liked: 2 times
Joined: Jul 18, 2018 1:04 pm
Full Name: Mike

Re: How to disable/enable tape job?

Post by tehinternet »

Nevermind, I figured it out.

my problem was trying to use other PS example for a 'normal' job disable and renable with Get-VBRjob. Then I learned tape jobs using different commandlets and the manual lead me to different commands for working with tapes (which have enable/disable options), but away from the simple disable/enable for the overall job.

As talked about here:
post148376.html?hilit=tape%20disable#p148376

I learned that I needed to use Get-VBRTapeJob and then the Disable-VBRJob and Enable-VBRJob.

I was a little confusing to me on how the tape and non-tape PS commands are separate, but overlap a little bit.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to disable/enable tape job?

Post by oleg.feoktistov »

Hi Mike,

Glad you could figure it out.
Anyway, we are ready to help.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests