Add-IpamSubnet
Add-IpamSubnet
Adds a subnet to IPAM.
Sintaxis
Parameter Set: AddIpamSubnet0
Add-IpamSubnet [-Name] <String> [-NetworkId] <String> [-AddressSpace <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-CustomConfiguration <String> ] [-Description <String> ] [-NetworkSite <String> ] [-NetworkType <VirtualizationType> ] [-Owner <String> ] [-PassThru] [-ThrottleLimit <Int32> ] [-VirtualSubnetId <UInt32> ] [-VlanId <UInt16[]> ] [-VmmLogicalNetwork <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The Add-IpamSubnet cmdlet adds an IP subnet to an IP Address Management (IPAM) server. Use the cmdlet to add a NonVirtualized, Provider or Customer IP subnet in IPAM. If the network type of the subnet to add is Provider or NonVirtualized, the cmdlet will add it to the default address space, unless you specify an address space. If the network type of the range to add is Customer, you must specify an address space.
You can associate virtualized subnets, either provider or customer, with a logical network and a network site. These properties represent an abstraction of a physical network and are inherited by all ranges and addresses that map to this subnet.
Parámetros
-AddressSpace<String>
Specifies an address space to which this IP address subnet belongs. If you not specify an address space, the cmdlet retrieves data for all address spaces configured in IPAM.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
Default |
¿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 |
-CustomConfiguration<String>
Specifies semicolon-separated name/value pairs. This parameter specifies custom metadata that is associated with the address space.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Description<String>
Specifies a description of the subnet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Name<String>
Specifies a name for the subnet.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-NetworkId<String>
Specifies the network and the prefix for the given subnet. Specify the network ID in Classless Interdomain Routing (CIDR) notation in the format Network/Prefix.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
3 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-NetworkSite<String>
Specifies a network site that is associated with a logical network and forms an abstraction of the physical network. A logical network can contain many network sites. This property is inherited by all ranges and addresses associated with the given subnet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-NetworkType<VirtualizationType>
Specifies an array of of network types for the addresses to add. Los valores aceptables para este parámetro son los siguientes:
-- Provider
-- Customer
-- NonVirtualized
If the value of the AddressSpace parameter is Default, then this parameter can take the value Provider or NonVirtualized. If the value of the AddressSpace 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 AddressSpace 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 network type defaults to NonVirtualized.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
NonVirtualized |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Owner<String>
Specifies the name of an owner for the subnet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-PassThru
Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.
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 |
-VirtualSubnetId<UInt32>
Specifies a virtual subnet ID. When you use network virtualization, this property, along with Customer address and Provider address is used to route packets to a particular customer VM.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-VlanId<UInt16[]>
Specifies an array of unique identifiers for VLANs.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-VmmLogicalNetwork<String>
Specifies the abstraction of a physical network that describes a particular function in your environment such as backend or frontend.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿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.
CimInstance#ROOT/microsoft/ipam/MSFT_IPAM_Subnet
Represents an IP Subnet in IPAM Server.
Ejemplos
Example 1: Add a subnet
This command adds an IPv4 subnet and associates it with VLANs.
PS C:\>Add-IpamSubnet -Name Contoso_2 -NetworkId 10.12.0.0/16 -VlanId 13,10 -PassThru
Example 2: Add a subnet to the default address space
This command adds an IPV4 subnet with network type provider to the default address space.
PS C:\> Add-IpamSubnet -Name Contoso_3 -NetworkId 10.13.0.0/16 -NetworkType Provider -VmmLogicalNetwork Storage -NetworkSite Site03 -VlanId 13,10 -PassThru
Example 3: Add a subnet for a customer network type
This command adds an IPv4 subnet with network type customer.
PS C:\> Add-IpamSubnet -Name Contoso_3 -NetworkId 10.13.0.0/16 -NetworkType Customer -AddressSpace NetCat -VmmLogicalNetwork Storage -NetworkSite Site03 -VirtualSubnetId 10 -PassThru
Example 4: Add a subnet and attach metadata
This command adds physical subnets and attaches AD Site metadata to the subnets.
PS C:\> Add-IpamSubnet -Name Contosov6_10 -NetworkId 2001:db8::ff00/120 -CustomConfiguration "Country=United States;ADSite=Site01" | Format-List Name, NetworkId, Overlapping, CustomConfiguration