PowerShell script exchange
Post Reply
jbennett
Enthusiast
Posts: 33
Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:

Updating Proxies for all Backup Jobs by Site

Post by jbennett » 2 people like this post

I wrote the following based off the post (powershell-f26/set-vbrjobproxy-multiple ... 30558.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/ ... 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
}
Best of luck,
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests