Enable/Disable Health Checks for Multiple Jobs


Userlevel 4
Badge

Hello again, everyone! Just sharing another useful PowerShell script to enable/disable Health Checks for multiple jobs. It’s handy whenever you have a large number of jobs which all need to be adjusted and would take a significant amount of time to do so. Usually I wouldn’t share such a short script, but the way to locate and adjust this particular option in a job via PowerShell can be a little confusing if you’re a PowerShell novice.

I decided to provide multiple examples for editing various job types and not just an all-or-nothing approach. I hope someone finds these useful! If I missed anything, please let me know and I’ll include it.

NOTE: These are all examples of how to disable Health Checks. To flip it around to have it enable Health Checks, simply change $false to $true.

 

For ALL jobs:

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue

foreach ($job in Get-VBRJob) {
$options = Get-VBRJobOptions -Job $job
$options.GenerationPolicy.EnableRechek = $false
Set-VBRJobOptions -Job $job -Options $options | Out-Null
}

 

For just Backup Jobs (VMware/HyperV):

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue

foreach ($job in Get-VBRJob) {
if ($job.JobType -eq 'Backup') {
$options = Get-VBRJobOptions -Job $job
$options.GenerationPolicy.EnableRechek = $false
Set-VBRJobOptions -Job $job -Options $options | Out-Null
}
}

 

For just Agent Backup (Managed by VBR) Jobs:

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue

foreach ($job in Get-VBRJob) {
if ($job.JobType -eq 'EpAgentBackup') {
$options = Get-VBRJobOptions -Job $job
$options.GenerationPolicy.EnableRechek = $false
Set-VBRJobOptions -Job $job -Options $options | Out-Null
}
}

 

For just Backup Copy (VMware/Hyper-V/Agent) Jobs:

Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue

foreach ($job in Get-VBRJob){
if ($job.JobType -eq 'BackupSync' -or $job.JobType -eq 'SimpleBackupCopyPolicy') {
$options = Get-VBRJobOptions -Job $job
$options.GenerationPolicy.EnableRechek = $false
Set-VBRJobOptions -Job $job -Options $options | Out-Null
}
}

 


4 comments

Userlevel 7
Badge +20

Great post @CptAmerica always nice to see scripts that benefit the community.  Will add these to my repository.

Userlevel 7
Badge +16

@CptAmerica  the PowerShell Avenger 😎👍🏼

Userlevel 7
Badge +4

@CptAmerica : good share !

Userlevel 7
Badge +12

Again, nice share @CptAmerica 

Comment