Get-VBRAzureVirtualNetworkSubnet

In this article

    Short Description

    Returns Microsoft Azure virtual network subnets available for a subscription.

    Applies to

    Platform: VMware, Hyper-V

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

    Syntax

    Get-VBRAzureVirtualNetworkSubnet -Network <VBRAzureVirtualNetwork> [-Name <string[]>]  [<CommonParameters>]

    Detailed Description

    This cmdlet returns virtual network subnets available for a Microsoft Azure subscription.

    Important

    This cmdlet does not support Microsoft Azure accounts with the Azure Service Manager type of a subscription (ASM, also known as a "classic" type subscription).

    Parameters

    Parameter

    Description

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    Network

    Specifies the virtual network. The cmdlet will return subnets of this virtual network.

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    False

    Name

    Specifies the array of names. The cmdlet will return virtual networks that match the specified names.

    False

    Named

    False

    True

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

    Return Type

    VBRAzureNetworkSubnet

    Example 1

    This example shows how to get all virtual network subnets associated with a subscription.

    1. Run Get-VBRAzureAccount to get the account. Save it to the $account variable.
    2. Run Get-VBRAzureSubscription with the $account variable to get the subscription. Save it to the $subscription variable.
    3. Run Get-VBRAzureVirtualNetwork with the $subscription variable to get the network. Save it to the $network variable.
    4. Run Get-VBRAzureVirtualNetworkSubnet with the $network variable.

    $account = Get-VBRAzureAccount -Name "RestoreToAzureRM@Veeam.com"

    $subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

    $network = Get-VBRAzureVirtualNetwork -Subscription $subscription -Name "VeeamInternalNetwork"

    Get-VBRAzureVirtualNetworkSubnet -Network $network

    Example 2

    This example shows how to get a virtual network subnet by the subnet name.

    1. Run Get-VBRAzureAccount to get the account. Save it to the $account variable.
    2. Run Get-VBRAzureSubscription with the $account variable to get the subscription. Save it to the $subscription variable.
    3. Run Get-VBRAzureVirtualNetwork with the $subscription variable. Save it to the $network variable.
    4. Run Get-VBRAzureVirtualNetworkSubnet with the $network variable. Specify the name of the subnet you want to get.

    $account = Get-VBRAzureAccount -Name "RestoreToAzureRM@Veeam.com"

    $subscription = Get-VBRAzureSubscription -Account $account -Name "VeeamDirectRestore2Azure"

    $network = Get-VBRAzureVirtualNetwork -Subscription $subscription -Name "VeeamInternalNetwork"

    Get-VBRAzureVirtualNetworkSubnet -Network $network -Name "VeeamInternalSubnet"

    Related Commands

    Get-VBRAzureSubscription