Get-VBROracleCloudCompartment

Short Description

Returns compartments in Oracle Cloud Infrastructure.

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

Syntax

Get-VBROracleCloudCompartment -Account <VBROracleCloudAccount> [-Name <String[]>] [-AccessibleOnly] [<CommonParameters>]

Detailed Description

This cmdlet returns an array of compartments that belong to the tenancy of the specified Oracle Cloud Infrastructure account.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

AccessibleOnly

Defines that the cmdlet will return only compartments that the OCI account can access.

If you do not provide this parameter, the cmdlet will return all compartments of the tenancy.

SwitchParameter

False

Named

False

Account

Specifies the OCI account. The cmdlet will return compartments of the tenancy that this account belongs to.

Accepts the VBROracleCloudAccount object. To get this object, run the Get-VBROracleCloudAccountReturns Oracle Cloud Infrastructure accounts. cmdlet.

VBROracleCloudAccount

True

Named

True (ByPropertyName, ByValue)

Name

Specifies an array of names of compartments. The cmdlet will return compartments with these names.

You can use wildcard characters in the names.

String[]

False

Named

False

<CommonParameters>

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

Output Object

The cmdlet returns the VBROracleCloudCompartment object that contains the compartment settings.

Examples

Get-VBROracleCloudCompartmentExample 1. Getting All Compartments

This example shows how to get all compartments of the Oracle Cloud Infrastructure account.

$account = Get-VBROracleCloudAccount -Name "My OCI Account"

Get-VBROracleCloudCompartment -Account $account

Perform the following steps:

  1. Run the Get-VBROracleCloudAccountReturns Oracle Cloud Infrastructure accounts. cmdlet. Specify the Name parameter value. Save the result to the $account variable.
  2. Run the Get-VBROracleCloudCompartment cmdlet. Set the $account variable as the Account parameter value.

Get-VBROracleCloudCompartmentExample 2. Getting Accessible Compartment by Name

This example shows how to get a compartment by its name. The cmdlet will return the compartment only if the account has access to it.

$account = Get-VBROracleCloudAccount -Name "My OCI Account"

$compartment = Get-VBROracleCloudCompartment -Account $account -Name "Restore" -AccessibleOnly

Perform the following steps:

  1. Run the Get-VBROracleCloudAccountReturns Oracle Cloud Infrastructure accounts. cmdlet. Specify the Name parameter value. Save the result to the $account variable.
  2. Run the Get-VBROracleCloudCompartment cmdlet. Specify the following settings:
    • Set the $account variable as the Account parameter value.
    • Specify the Name parameter value.
    • Provide the AccessibleOnly parameter.

    Save the result to the $compartment variable to use it when you run the Start-VBRVMRestoreToOracleCloudStarts a restore session to Oracle Cloud Infrastructure. cmdlet.

Page updated 2026-11-09

Page content applies to build 13.2.0.193