--- title: "Get-VBROracleCloudNetworkSecurityGroup" description: "This cmdlet returns an array of network security groups that belong to the specified virtual cloud network (VCN) in Oracle Cloud Infrastructure." canonical: "https://helpcenter.veeam.com/docs/vbr/powershell/get-vbroraclecloudnetworksecuritygroup.html" breadcrumb: "Veeam PowerShell Reference > Veeam PowerShell Reference > Data Recovery > Restore to Oracle Cloud Infrastructure > Recovery > Get-VBROracleCloudNetworkSecurityGroup" dateModified: "2026-11-09" --- # Get-VBROracleCloudNetworkSecurityGroup ## Short Description Returns network security groups in Oracle Cloud Infrastructure. **Product Edition**: Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` Get-VBROracleCloudNetworkSecurityGroup -Vcn -Compartment [-Name ] [] ``` ## Detailed Description This cmdlet returns an array of network security groups that belong to the specified virtual cloud network (VCN) in Oracle Cloud Infrastructure. ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Compartment

Specifies the compartment. The cmdlet will return network security groups in this compartment.

Note: The compartment must belong to the same OCI account as the VCN that you specify in the Vcn parameter.

Accepts the VBROracleCloudCompartment object. To get this object, run the Get-VBROracleCloudCompartment cmdlet.

VBROracleCloudCompartment

True

Named

True (ByPropertyName)

Name

Specifies an array of names of network security groups. The cmdlet will return network security groups with these names.

You can use wildcard characters in the names.

String[]

False

Named

False

Vcn

Specifies the virtual cloud network (VCN). The cmdlet will return network security groups of this VCN.

Note: The VCN must belong to the same OCI account as the compartment that you specify in the Compartment parameter.

Accepts the VBROracleCloudVcn object. To get this object, run the Get-VBROracleCloudVcn cmdlet.

VBROracleCloudVcn

True

Named

True (ByPropertyName, ByValue)

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see [ Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7). ## Output Object The cmdlet returns the [`VBROracleCloudNetworkSecurityGroup`](vbroraclecloudnetworksecuritygroup.md) object that contains the network security group settings. ## Examples ::: example ### Example 1. Getting Network Security Group by Name This example shows how to get a network security group by its name. ``` $account = Get-VBROracleCloudAccount -Name "My OCI Account" $region = Get-VBROracleCloudRegion -Account $account -Name "eu-frankfurt-1" $compartment = Get-VBROracleCloudCompartment -Account $account -Name "Restore" $vcn = Get-VBROracleCloudVcn -Region $region -Compartment $compartment -Name "Restore VCN" $nsg = Get-VBROracleCloudNetworkSecurityGroup -Compartment $compartment -Vcn $vcn -Name "Restore NSG" ``` Perform the following steps: 1. Run the [`Get-VBROracleCloudAccount`](get-vbroraclecloudaccount.md) cmdlet. Specify the `Name` parameter value. Save the result to the `$account` variable. 2. Run the [`Get-VBROracleCloudRegion`](get-vbroraclecloudregion.md) cmdlet. Set the `$account` variable as the `Account` parameter value. Specify the `Name` parameter value. Save the result to the `$region` variable. 3. Run the [`Get-VBROracleCloudCompartment`](get-vbroraclecloudcompartment.md) cmdlet. Set the `$account` variable as the `Account` parameter value. Specify the `Name` parameter value. Save the result to the `$compartment` variable. 4. Run the [`Get-VBROracleCloudVcn`](get-vbroraclecloudvcn.md) cmdlet. Specify the following settings: - Set the `$region` variable as the `Region` parameter value. - Set the `$compartment` variable as the `Compartment` parameter value. - Specify the `Name` parameter value. Save the result to the `$vcn` variable. 5. Run the `Get-VBROracleCloudNetworkSecurityGroup` cmdlet. Specify the following settings: - Set the `$compartment` variable as the `Compartment` parameter value. - Set the `$vcn` variable as the `Vcn` parameter value. - Specify the `Name` parameter value. Save the result to the `$nsg` variable to use it when you run the [`Start-VBRVMRestoreToOracleCloud`](start-vbrvmrestoretooraclecloud.md) cmdlet. :::