Find-IpamFreeAddress

Find-IpamFreeAddress

Gets one or more free IP addresses from a range of IP addresses in IPAM.

Syntax

Parameter Set: Metric
Find-IpamFreeAddress [-InputObject] <CimInstance> [[-NumAddress] <UInt32> ] [-AsJob] [-CimSession <CimSession[]> ] [-TestReachability] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Detailed Description

The Find-IpamFreeAddress cmdlet gets one or more free IP addresses from a range of IP addresses in IP Address Management (IPAM). If you specify the NumAddress parameter, the cmdlet returns the requested number of free IPv4 addresses. If you do not specify the NumAddress parameter, the cmdlet returns a single free IP address. The maximum number of free IP addresses that the cmdlet returns is 1024. The cmdlet does not include exclusion address ranges, reservations, and assigned addresses among the free IP addresses. If the requested number of free IP addresses could not be found, a warning occurs. If you specify the TestReachability parameter, IPAM returns a ping status and a DNS record status for each of the IP address that it returns.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InputObject<CimInstance>

Specifies the range from which to get one or more free IP addresses.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-NumAddress<UInt32>

Specifies the number of free addresses to get. A warning occurs if the number of free addresses returned is less than the number requested. If you do not specify this parameter, the cmdlet returns a single free address.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TestReachability

Indicates that the cmdlet tests the reachability of the IP addresses.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • IpamFreeAddress

    Represents an unallocated IP address in IPAM server. Along with the IP address, the object also contains flags that specify whether IPAM server was able to ping the IP address and whether IPAM server found an associated DNS record.

Examples

Example 1: Find a free IP address

This command finds a free IP address from a range in IPAM. By default, IPAM does not test the reachability of the address or the existence of a corresponding DNS record.

PS C:\> Get-IpamRange -StartIPAddress 10.12.3.1 -EndIPAddress 10.12.3.254 | Find-IpamFreeAddress

Example 2: Find a free IP address and test the reachability of the address

This command finds 10 free IP address from a range in IPAM, and checks if the IP addresses are reachable and whether there is a corresponding DNS record.

PS C:\> $FreeIPs=Get-IpamRange -StartIPAddress 10.12.3.1 -EndIPAddress 10.12.3.254|Find-IpamFreeAddress -NumAddress 10 -TestReachability
PS C:\>$FreeIPs[0]