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/ ... roxies.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
}