Updating Proxies for all Backup Jobs by Site

PowerShell script exchange

Updating Proxies for all Backup Jobs by Site

Veeam Logoby jbennett » Thu Aug 04, 2016 12:21 am 2 people like this post

I wrote the following based off the post (https://forums.veeam.com/powershell-f26/set-vbrjobproxy-multiple-proxies-t30558.html) to update my job's proxies to use by site. It works great, so you don't have to click through every job to set a proxy.

It finds the pre-determined proxies based off your search criteria (i'm using the proxy name) and backup jobs based (I'm searching the backup jobs and defining the sites based off the site being in the backup job's name.)

Now, I thought I should share. Like or boo if you feel.

Latest version: https://github.com/cajeeper/Veeam/blob/master/Update%20BackupJob%20Proxies.ps1
Code: Select all
#Load Veeam Snap-in
Add-PSSnapin VeeamPSSnapin

#Connect to VBR Server
Connect-VBRServer -Server veeamstore.local
 
#Get Proxies
$Proxies = Get-VBRViProxy

#Assign Site Specific Proxies
$SiteAProxies = $Proxies | ? { $_.Name -match "proxy1.sitea.local|proxy2.siteb.local" }
$SiteBProxies = $Proxies | ? { $_.Name -match "proxy1.siteb.local" }

#Get Backup Jobs
$BackupJobs = Get-VBRJob | ? { $_.IsBackupJob }

#Get Site Specific Jobs
$SiteABackupJobs = $BackupJobs | ? { $_.Name -match "SiteA" }
$SiteBBackupJobs = $BackupJobs | ? { $_.Name -match "SiteB" }

#Update Job's - Disable AutoDetect and Manual Set Proxies

$SiteABackupJobs | % {
$_.Options.JobOptions.SourceProxyAutoDetect = $false
$_ | Set-VBRJobProxy -Proxy $SiteAProxies
}

$SiteBBackupJobs | % {
$_.Options.JobOptions.SourceProxyAutoDetect = $false
$_ | Set-VBRJobProxy -Proxy $SiteBProxies
}


Best of luck,
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
jbennett
Enthusiast
 
Posts: 33
Liked: 12 times
Joined: Tue Jun 23, 2015 3:47 pm
Location: Hemet, CA
Full Name: Justin Bennett

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests