Test-AzureRmPrivateIPAddressAvailability

Test availability of a private IP address in a virtual network.

Syntax

Test-AzureRmPrivateIPAddressAvailability
    -VirtualNetwork <PSVirtualNetwork>
    -IPAddress <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmPrivateIPAddressAvailability
    -ResourceGroupName <String>
    -VirtualNetworkName <String>
    -IPAddress <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Test-AzureRmPrivateIPAddressAvailability cmdlet tests whether a specified private IP address is available in a virtual network. This cmdlet returns a list of available private IP addresses if the requested private IP address is taken.

Examples

Example 1: Test whether an IP address is available using the pipeline

PS C:\>Get-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $rgname | Test-AzureRmPrivateIPAddressAvailability -IPAddress "10.0.1.10"

This command gets a virtual network and uses the pipeline operator to pass it to Test-AzureRmPrivateIPAddressAvailability, which tests whether the specified private IP address is available.

Required Parameters

-IPAddress

Specifies the IP address to test.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group for the virtual network.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VirtualNetwork

Specifies a PSVirtualNetwork object.

Type:Microsoft.Azure.Commands.Network.Models.PSVirtualNetwork
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VirtualNetworkName

Specifies the name of the virtual network.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSVirtualNetwork

Parameter 'VirtualNetwork' accepts value of type 'PSVirtualNetwork' from the pipeline

Outputs

Microsoft.Azure.Commands.Network.Models.PSIPAddressAvailabilityResult