Hi
I'm trying to script the creation of Protection Groups based on Clusters found in AD.
#Find clusters.
$AD = Get-VBRADDomain -ServerName $domainc -Credentials $credentials
$root = Find-VBRADEntity -Domain $AD
$clustersMX = Find-VBRADEntity -Domain $AD -Root $root -Recurse -Type Cluster |Where-Object{$_.Name -like ($site + "*MX*")}
#Create containers to be used in the Protection groups.
$scopeMX = New-VBRADContainer -Domain $AD -Entity $clustersMX -MasterCredentials $credentials -ExcludeVMs $false
When creating the containers, I would like to set the ExcludeVMs to $false but this is not possible.
New-VBRADContainer : A positional parameter cannot be found that accepts argument 'False'.
At line:1 char:12
+ $scopeMX = New-VBRADContainer -Domain $AD -Entity $clustersMX -Master ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-VBRADContainer], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Veeam.Backup.PowerShell.Cmdlets.NewVBRADContainer
#Create Protection Group
Add-VBRProtectionGroup -Name $clustersMX.Name.Substring(0,14) -Container $scopeMX -Description $descrMX -DeploymentOptions $options -AdvancedOptions $advoptions -NotificationOptions $notify
The ExcludeVMs property is ReadOnly:
>$scopeMX.ExcludeVMs = $false
'ExcludeVMs' is a ReadOnly property.
At line:1 char:1
+ $scopeMX.ExcludeVMs = $false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
-
- Enthusiast
- Posts: 37
- Liked: 3 times
- Joined: Jun 26, 2019 3:28 pm
- Full Name: Filip Smeets
- Contact:
-
- Veeam Vanguard
- Posts: 282
- Liked: 113 times
- Joined: Apr 20, 2017 4:19 pm
- Full Name: Joe Houghes
- Location: Castle Rock, CO
- Contact:
Re: Creating Protection Groups
You need to set the Exclude VMs parameter with a colon like this:
Code: Select all
$scopeMX = New-VBRADContainer -Domain $AD -Entity $clustersMX -MasterCredentials $credentials -ExcludeVMs:$false
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
-
- Enthusiast
- Posts: 37
- Liked: 3 times
- Joined: Jun 26, 2019 3:28 pm
- Full Name: Filip Smeets
- Contact:
Re: Creating Protection Groups
It worked. Thx!
Who is online
Users browsing this forum: kyle.shuberg and 11 guests