Skip to main content
Solved

Enable encryption for all existing backup jobs using powershell

  • February 16, 2022
  • 10 comments
  • 1113 views

Hi guys,

 

I was wondering if it is possible to enable the encrypt option for all backup jobs using powershell. I already have created the encryption key/password. 

 

Your help would be appriciated.

 

Best answer by Chris.Arceneaux

Hello,

 

This can be accomplished using the Set-VBRJobAdvancedStorageOptions cmdlet.

 

Prior to this change, I also recommend you read our documentation where it discusses this change in more detail:

 

https://helpcenter.veeam.com/docs/backup/vsphere/encryption_best_practices.html#encryption-for-existing-jobs

10 comments

Chris.Arceneaux
Forum|alt.badge.img+5

Hello,

 

This can be accomplished using the Set-VBRJobAdvancedStorageOptions cmdlet.

 

Prior to this change, I also recommend you read our documentation where it discusses this change in more detail:

 

https://helpcenter.veeam.com/docs/backup/vsphere/encryption_best_practices.html#encryption-for-existing-jobs


JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • February 16, 2022

Please be aware that a new full backup is needed for all systems you activate encryption for. This can result in a huge amount of additional backup data.


MicoolPaul
Forum|alt.badge.img+23
  • February 16, 2022

Please be aware that a new full backup is needed for all systems you activate encryption for. This can result in a huge amount of additional backup data.

Came here to say this, this will be an active full, so if you’re using ReFS/XFS you won’t be benefiting from block cloning as efficiently until all of your old chains are replaced by the new chains.

I actually did a session on this with Rick Vanover a few weeks ago if it’s of interest:

 


JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • February 16, 2022

Please be aware that a new full backup is needed for all systems you activate encryption for. This can result in a huge amount of additional backup data.

Came here to say this, this will be an active full, so if you’re using ReFS/XFS you won’t be benefiting from block cloning as efficiently until all of your old chains are replaced by the new chains.

I actually did a session on this with Rick Vanover a few weeks ago if it’s of interest:

 

Correct, I forgot to mention the active full and the consequences for ReFS/XFS. :sunglasses: Good that the whole community have a look at this.


  • Author
  • New Here
  • March 11, 2022

Just an update,

 

I created a script to enable the encryption. I wanted to share with you guys

 

Disconnect-VBRServer
Connect-VBRServer -Server localhost

function Read-InputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText)
{
    Add-Type -AssemblyName Microsoft.VisualBasic
    return [Microsoft.VisualBasic.Interaction]::InputBox($Message, $WindowTitle, $DefaultText)
}

$ekey = Get-VBREncryptionKey -Description "Name of the Encryption Key that you configured"

$jobname = Read-InputBoxDialog -Message "Please enter job name to enable encryption" -WindowTitle "Which Job"

$job = Get-VBRJob -Name $jobname
Set-VBRJobAdvancedStorageOptions -Job $job -EnableEncryption $True -EncryptionKey $ekey


MicoolPaul
Forum|alt.badge.img+23

Just an update,

 

I created a script to enable the encryption. I wanted to share with you guys

 

Disconnect-VBRServer
Connect-VBRServer -Server localhost

function Read-InputBoxDialog([string]$Message, [string]$WindowTitle, [string]$DefaultText)
{
    Add-Type -AssemblyName Microsoft.VisualBasic
    return [Microsoft.VisualBasic.Interaction]::InputBox($Message, $WindowTitle, $DefaultText)
}

$ekey = Get-VBREncryptionKey -Description "Name of the Encryption Key that you configured"

$jobname = Read-InputBoxDialog -Message "Please enter job name to enable encryption" -WindowTitle "Which Job"

$job = Get-VBRJob -Name $jobname
Set-VBRJobAdvancedStorageOptions -Job $job -EnableEncryption $True -EncryptionKey $ekey

Good work on the script, again I’d just echo that you’ve factored in the amount of time it’ll take to perform active full backups on all of your jobs and that you’ve got sufficient repository space is you carry this out on all jobs simultaneously, but this is certainly a fast way to achieve this.


JMeixner
Forum|alt.badge.img+16
  • On the path to Greatness
  • March 11, 2022

Good work on the script, again I’d just echo that you’ve factored in the amount of time it’ll take to perform active full backups on all of your jobs and that you’ve got sufficient repository space is you carry this out on all jobs simultaneously, but this is certainly a fast way to achieve this.

You don’t have to enable encryption on all jobs at the same time.

So the active fulls are done at different days and it’s not that bad. :sunglasses:


  • New Here
  • March 24, 2022

Thank you for the script. Works great. Made a few changes to perform a bulk update.


vAdmin
Forum|alt.badge.img+2
  • Influencer
  • December 3, 2022

Wow, this is great, thank you @ldasilva for sharing the great script.


Scott
Forum|alt.badge.img+9
  • Veeam Legend
  • December 5, 2022

Handy script, but if anyone is reading it be warned if your jobs all run the same day they will ALL do an active full and take up a lot of space. 

 

If your jobs are small, or you have lots of room this would be great. For myself I’ll do 1 here and there to not overload my repo.