Add-IpamSubnet

Add-IpamSubnet

Adds a subnet to IPAM.

Syntax

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>]

Detailed Description

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.

Parameters

-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.

Aliases

none

Required?

false

Position?

named

Default Value

Default

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-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

-CustomConfiguration<String>

Specifies semicolon-separated name/value pairs. This parameter specifies custom metadata that is associated with the address space.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Description<String>

Specifies a description of the subnet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name for the subnet.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

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.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NetworkType<VirtualizationType>

Specifies an array of of network types for the addresses to add. The acceptable values for this parameter are:

-- 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.

Aliases

none

Required?

false

Position?

named

Default Value

NonVirtualized

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Owner<String>

Specifies the name of an owner for the subnet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

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

-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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VlanId<UInt16[]>

Specifies an array of unique identifiers for VLANs.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VmmLogicalNetwork<String>

Specifies the abstraction of a physical network that describes a particular function in your environment such as backend or frontend.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

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.

  • CimInstance#ROOT/microsoft/ipam/MSFT_IPAM_Subnet

    Represents an IP Subnet in IPAM Server.

Examples

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

Export-IpamSubnet

Get-IpamSubnet

Import-IpamSubnet

Remove-IpamSubnet

Set-IpamSubnet