Find-IpamFreeAddress
Find-IpamFreeAddress
Gets one or more free IP addresses from a range of IP addresses in IPAM.
Sintaxis
Parameter Set: Metric
Find-IpamFreeAddress [-InputObject] <CimInstance> [[-NumAddress] <UInt32> ] [-AsJob] [-CimSession <CimSession[]> ] [-TestReachability] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Descripción detallada
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.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-InputObject<CimInstance>
Specifies the range from which to get one or more free IP addresses.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
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.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
3 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-TestReachability
Indicates that the cmdlet tests the reachability of the IP addresses.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
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.
Ejemplos
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]