Get-IpamSubnet
Get-IpamSubnet
Gets a set of subnets from IPAM.
Sintaxis
Parameter Set: ByAF
Get-IpamSubnet [-AddressFamily] <AddressFamily[]> [-AddressSpace <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-NetworkType <VirtualizationType[]> ] [-ThrottleLimit <Int32> ] [-Unmapped] [ <CommonParameters>]
Parameter Set: ByBlock
Get-IpamSubnet -MappingToBlock <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ById
Get-IpamSubnet -NetworkId <String[]> [-AddressSpace <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-NetworkType <VirtualizationType[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Descripción detallada
The Get-IpamSubnet cmdlet gets a set of IP subnets from IP Address Management (IPAM). By default, the cmdlet gets all IP addresses of a given address family from all address spaces configured in IPAM. Use the NetworkType and AddressSpace parameters to filter the result for Provider and Customer subnets, or NonVirtualized subnets.
This cmdlet also provides parameter sets to retrieve all subnets that map to a given IP address block.
Parámetros
-AddressFamily<AddressFamily[]>
Specifies an address family of IP addresses.Los valores aceptables para este parámetro son los siguientes:
-- IPv4
-- IPv6
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-AddressSpace<String[]>
Specifies an array of names of address spaces. If you not specify an address space, the cmdlet gets data for all address spaces configured in IPAM.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-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 |
-MappingToBlock<CimInstance>
Specifies the subnets that map to an address block.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-NetworkId<String[]>
Specifies an array of networks and prefixes. Specify the network ID in Classless Interdomain Routing (CIDR) notation in the format Network/Prefix.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-NetworkType<VirtualizationType[]>
Specifies the type of network for the given subnet. Los valores aceptables para este parámetro son los siguientes:
-- Provider
-- Customer
-- NonVirtualized
If the value of the parameter is Default, then this parameter can take the value Provider or NonVirtualized. If the value of the parameter is Provider, then the value of this parameter, if specified, must be Provider. Specifying any other value for this parameter will result in an error. Similarly, if the value of the parameter is Customer, then the value of this parameter, if specified, must be Customer. Specifying any other value for this parameter will result in an error.
If you do not specify this parameter, the cmdlet returns all subnets that match the criteria, regardless of network type.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿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 |
-Unmapped
Indicates that the cmdlet gets subnets that are not mapped to any IP address block.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿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.
- IpamSubnet
Ejemplos
Example 1 Get all overlapping subnets
This command gets all overlapping subnets in the default address space, including Provider and NonVirtualized subnets in the default address space.
PS C:\> Get-IpamSubnet -AddressFamily IPv4 -AddressSpace Default | where {$_.Overlapping -eq $false}
Example 2: Get all non-virtualized subnets in a site
This command gets all non-virtualized subnets assigned to the site named Contoso AD-Site.
PS C:\> Get-IpamSubnet -AddressFamily IPv4 -NetworkType NonVirtualized|where {$_.CustomConfiguration -Like "*ADSite=Contoso*"}| Format-List Name, NetworkId, CustomConfiguration
Example 3: Get all IPv4 subnets
This command gets all provider IPv4 subnets in the default address space.
PS C:\> Get-IpamSubnet -AddressFamily IPv4 -NetworkType Provider -AddressSpace Default
Example 4: Get all unmapped non-virtualized subnets
This command gets all unmapped non-virtualized subnets in the default address space
PS C:\> Get-IpamSubnet -AddressFamily IPv4 -NetworkType NonVirtualized -Unmapped
Example 5: Get all subnets in a customer address space
This command gets all subnets that belong to the ContosoWest customer address space and a logical network.
PS C:\> Get-IpamSubnet -AddressFamily IPv4 -NetworkType Customer -AddressSpace ContosoWest|Where {$_.VmmLogicalNetwork -eq "Storage"}