Set-VBRMongoDBContainer

Short Description

Modifies MongoDB containers that include an array of custom credentials.

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

Set-VBRMongoDBContainer -Container <VBRMongoDBContainer> [-CustomCredentials <VBRMongoDBCustomCredentials[]>] [<CommonParameters>]

Detailed Description

This cmdlet modifies the VBRMongoDBContainer object. This object contains the scope of computers included in a MongoDB container.

Note

To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameter values with new values. The parameters that you omit will remain unchanged.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Container

Specifies the MongoDB container that includes computers whose custom credentials you want to modify.

Accepts the VBRMongoDBContainer object. To get this object, run the New-VBRMongoDBContainerCreates a MongoDB container for an array of existing custom credentials. cmdlet.

VBRMongoDBContainer

True

Named

True (ByPropertyName, ByValue)

CustomCredentials

Specifies custom credentials of computers within the specified MongoDB container.

Accepts the VBRMongoDBCustomCredentials[] object. To get this object run the New-VBRMongoDBCustomCredentialsCreates custom credentials for computers within MongoDB replica sets to be selected for backup operations. cmdlet.

VBRMongoDBCustomCredentials[]

False

Named

True (ByPropertyName)

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

The cmdlet returns the VBRMongoDBContainer object.

Examples

Adding a Replica Set to an Existing MongoDB Protection Group

This example shows how to add a MongoDB replica set to an existing MongoDB protection group.

$mongoCredentials = (Get-VBRCredentials -Name "admin")[1]

$NewReplicaSet = New-VBRMongoDBDeployment -HostName host01 -Credentials $mongoCredentials -Port 27017

$rsComputers = Get-VBRMongoDBComputer -Deployment $NewReplicaSet

$computer1CustomCredentials = New-VBRMongoDBCustomCredentials -Computer $rsComputers[1] -UseTemporaryCertificate

$mng_PG = Get-VBRProtectionGroup -name "MongoDB Protection Group"

$comp = $mng_PG.Container.CustomCredentials

$comp += $computer1CustomCredentials

$newcomp = Set-VBRMongoDBContainer -Container $mng_PG.Container -CustomCredentials $comp

Set-VBRProtectionGroup -ProtectionGroup $mng_PG -Container $newcomp

Perform the following steps:

  1. Create a new replica set:
    1. Run the Get-VBRCredentialsReturns credentials records. cmdlet. Specify the Name parameter value with the user account you want to connect with. Save the result to the $mongoCredentials variable.
    2. Run the New-VBRMongoDBDeploymentConnects to and adds MongoDB replica sets to protection groups. cmdlet.
    • Specify the HostName parameter value with the DNS name or IP address of the computer within the replica set.
    • Specify the Credentials parameter value with the $mongoCredentials variable.
    • Specify the Port parameter value with the port number 27017.
    • Save the result to the $NewReplicaSet variable.
      1. Run the Get-VBRMongoDBComputerReturns a list of all computers within specified replica sets. cmdlet. Specify the Deployment parameter value with the name of a specific replica set $NewReplicaSet. Save the result to the $rsComputers variable.
      2. Run the New-VBRMongoDBCustomCredentialsCreates custom credentials for computers within MongoDB replica sets to be selected for backup operations. cmdlet. Specify the Computer parameter value with the name of a specific computer within the replica set. Use the UseTemporaryCertificate parameter to use a temporary certificate instead of custom credentials. Save the result to the $computer1CustomCredentials variable.
  2. Run the Get-VBRProtectionGroupReturns protection groups. cmdlet. Specify the Name parameter value. Save the result to the $mng_PG variable.
  3. Get the scope of computers with MongoDB nodes. Use the Container.CustomCredentials property of the $mng_PG variable. Save the result to the $comp variable.
  4. Add the computer to the group of computers in the $comp variable. Use the += operator.
  5. Run the Set-VBRMongoDBContainer cmdlet. Specify the Container parameter value with the Container property of the $mng_PG variable. Specify the CustomCredentials parameter value with the $comp variable. Save the result to the $newcomp variable.
  6. Run the Set-VBRProtectionGroupModifies protection groups. cmdlet. Specify the ProtectionGroup parameter value with the $mng_PG variable. Specify the Container parameter value with the $newcomp variable.

Page updated 2026-09-02

Page content applies to build 13.1.1.18