PowerShell script exchange
Post Reply
vbrlearning
Lurker
Posts: 2
Liked: never
Joined: Feb 11, 2019 11:19 am
Contact:

Powershell script for protection group update

Post by vbrlearning »

Hello Guys,

Could someone please help me with powershell script to uncheck "install backup agent automatically" in protection group.
We have many protection group we need to uncheck this before performing upgrade to UP4.

this giving me error-
$PS = Get-VBRProtectionGroup -Name za_joh_win_physical_prod
Set-VBRProtectionGroup -ProtectionGroup $PG -DeploymentOptions $False

I am still learning; Would be great if someone has it with loop?
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell script for protection group update

Post by veremin » 1 person likes this post

- You need to create a new protection group deployment options, using New-VBRProtectionGroupDeploymentOptions cmdlet
- While doing so, you need to set a $False value to -InstallAgent switch
- Pass new deployment options to your protection group

For instance,

Code: Select all

$PG = Get-VBRProtectionGroup -Name za_joh_win_physical_prod
$DeploymentOptions = New-VBRProtectionGroupDeploymentOptions -InstallAgent:$False
Set-VBRProtectionGroup -ProtectionGroup $PG -DeploymentOptions $DeploymentOptions
Thanks!
vbrlearning
Lurker
Posts: 2
Liked: never
Joined: Feb 11, 2019 11:19 am
Contact:

Re: Powershell script for protection group update

Post by vbrlearning »

hello Thanks for that script.

Its worked perfertly fine :)

$PG = Get-VBRProtectionGroup -Name za_joh_win_physical_prod
$DeploymentOptions = New-VBRProtectionGroupDeploymentOptions -InstallAgent:$False
Set-VBRProtectionGroup -ProtectionGroup $PG -DeploymentOptions $DeploymentOptions

But can you share me with loop; let support I have 10 different protection group ?
abc1
abc2..
..
.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell script for protection group update

Post by veremin »

- Save all names in variable
- Go over them one by one within a loop and apply require settings

For example (don't have a console at hand, so few modifications might be needed):

Code: Select all

$Names = "name1","name2", etc.
foreach ($Name in $Names)
{ 
$PG = Get-VBRProtectionGroup -Name $Name
$DeploymentOptions = New-VBRProtectionGroupDeploymentOptions -InstallAgent:$False
Set-VBRProtectionGroup -ProtectionGroup $PG -DeploymentOptions $DeploymentOptions
}
By the way, let's use public forums instead of private messages, so that other users can benefit from the results of our discussion.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests