Test-AzPrivateIPAddressAvailability
Test availability of a private IP address in a virtual network.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Test-AzPrivateIPAddressAvailability
-VirtualNetwork <PSVirtualNetwork>
-IPAddress <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Test-AzPrivateIPAddressAvailability
-ResourceGroupName <String>
-VirtualNetworkName <String>
-IPAddress <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Test-AzPrivateIPAddressAvailability 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-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname | Test-AzPrivateIPAddressAvailability -IPAddress "10.0.1.10"
This command gets a virtual network and uses the pipeline operator to pass it to Test-AzPrivateIPAddressAvailability, which tests whether the specified private IP address is available.
Parameters
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the IP address to test.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
Specifies a PSVirtualNetwork object.
| Type: | PSVirtualNetwork |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the virtual network.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |