Search This Blog

Wednesday, July 12, 2023

Change Veeam Backup Job Setting with PowerShell | Maintain Same Job Name

There is no rename PowerShell cmdlet on veeam v12. So here is my workaround to maintain the same backup job. If I use the clone backup job name, it will perform an active full when scheduling the job run. This is a norm scenario as the backup job name has changed and existing backup data cannot map.

# Connect to the Veeam Backup & Replication server

Connect-VBRServer -Server "VBR12GA"


# Get the backup job you want to clone

$sourceJob = Get-VBRJob -Name "VmwareVM-DC01-demodomain"

# Get the new proxy server

$newProxy1 = Get-VBRViProxy -Name "proxy1.veeamlab.local"

$newProxy2 = Get-VBRViProxy -Name "proxy2.veeamlab.local"


#update proxy

Set-VBRJobProxy -Job $sourceJob -Proxy $newProxy1, $newProxy2


# Specify the name for the cloned job

$clonedJobName = "ClonedJobName-Lai"

$clonedJobNameOriginal = "VmwareVM-DC01-demodomain"


# Clone the backup job

$clonedJob1 = Copy-VBRJob -Job $sourceJob -Name $clonedJobName -Repository "Default Backup Repository"

Remove-VBRJob -Job $sourceJob -Confirm:$false

$clonedJob2 = Copy-VBRJob -Job $clonedJob1 -Name $clonedJobNameOriginal

Remove-VBRJob -Job $clonedJob1 -Confirm:$false


# Save the cloned job

Set-VBRJobOptions -Job $clonedJob2


# Disconnect from the Veeam Backup & Replication server

Disconnect-VBRServer