Edit

Share via


Get-IpamBlock

Gets a set of address blocks from IPAM.

Syntax

ByNetworkId

Get-IpamBlock
    -NetworkId <String[]>
    -StartIPAddress <IPAddress[]>
    -EndIPAddress <IPAddress[]>
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByAddressFamily

Get-IpamBlock
    [-AddressFamily] <AddressFamily[]>
    [[-AddressCategory] <AddressCategory[]>]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

ByParent

Get-IpamBlock
    -MappingToParentBlock <CimInstance>
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

Description

The Get-IpamBlock cmdlet gets a set of IP address blocks from IP Address Management (IPAM). Specify the AddressFamily parameter to get a set of IP addresses for address families. Specify the NetworkId, StartIPAddress, and EndIPAddress parameters to get a set of IP address blocks for networks. Specify the MappingToParentBlock parameter to get all child IP address ranges that belong to an address block.

Examples

Example 1: Get all private IPv4 address blocks

PS C:\> Get-IpamBlock -AddressFamily IPv4 -AddressCategory Private | Format-List NetworkId, StartIPAddress, EndIPAddress
NetworkId      : 10.0.0.0/8

StartIPAddress : 10.0.0.0

EndIPAddress   : 10.255.255.255

This command gets all private IPv4 blocks in IPAM. The command returns only the top-level blocks in the block hierarchy. The command uses the Format-List cmdlet to display the output in the form of a table. For more information, type Get-Help Format-Table.

Example 2: Get an address block by using a network Id

PS C:\> Get-IpamBlock -NetworkId "10.0.0.0/8" -StartIPAddress 10.0.0.0 -EndIPAddress 10.255.255.255
Utilization        : Under

NetworkId          : 10.0.0.0/8

StartAddress       : 10.0.0.0

EndAddress         : 10.255.255.255

Rir                :

LastAssignedDate   :

TotalAddresses     : 16777216

AssignedAddresses  : 2440

UtilizedAddresses  : 732

PercentageUtilized : 30

AddressCategory    : Private

Owner              :

Description        : IP block to be used for Region1

RirReceivedDate    :

PercentageAssigned : 0.01454353

This command gets the IP address block from the network that has the ID 10.0.0.0/8. The command specifies the start and end addresses for the address block.

Example 3: Get child IP address ranges mapped to an address block

PS C:\> $Parent = Get-IpamBlock -NetworkId "10.0.0.0/8" -StartIPAddress 10.0.0.0 -EndIPAddress 10.255.255.255PS
C:\> Get-IpamBlock -MappingToParentBlock $Parent
Utilization        : Under

NetworkId          : 10.11.0.0/16

StartAddress       : 10.11.0.0

EndAddress         : 10.11.255.255

Rir                :

LastAssignedDate   :

TotalAddresses     : 65536

AssignedAddresses  : 200

UtilizedAddresses  : 90

PercentageUtilized : 45

AddressCategory    : Private

Owner              :

Description        : IP block to be used for Region1

RirReceivedDate    :

PercentageAssigned : 0.3051758
Utilization        : Under

NetworkId          : 10.12.0.0/16

StartAddress       : 10.12.0.0

EndAddress         : 10.12.255.255

Rir                :

LastAssignedDate   :

TotalAddresses     : 65536

AssignedAddresses  : 0

UtilizedAddresses  : 0

PercentageUtilized : 0

AddressCategory    : Private

Owner              :

Description        : IP block to be used for Region1

RirReceivedDate    :

PercentageAssigned : 0

This example gets all child IP address ranges for an address block.

The first command gets an IpamBlock object that contains the IP address block from the network that has the ID 10.0.0.0/8. The command stores the IpamBlock object in the $Parent variable.

The second command gets all the child IP address ranges for the address block stored in $Parent.

Parameters

-AddressCategory

Specifies an array of IP address categories. If you specify this parameter, you must specify the AddressFamily parameter.

The acceptable values for this parameter are:

  • Public
  • Private

Parameter properties

Type:

AddressCategory[]

Default value:None
Accepted values:Public, Private, Global
Supports wildcards:False
DontShow:False

Parameter sets

ByAddressFamily
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AddressFamily

Specifies an array of address families of IP addresses.

The acceptable values for this parameter are:

  • IPv4
  • IPv6

Parameter properties

Type:

AddressFamily[]

Default value:None
Accepted values:IPv4, IPv6
Supports wildcards:False
DontShow:False

Parameter sets

ByAddressFamily
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet.

For more information about Windows PowerShell background jobs, see about_Jobs.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

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

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EndIPAddress

Specifies an array of end addresses for IP address blocks.

Parameter properties

Type:

IPAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNetworkId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MappingToParentBlock

Specifies an IpamBlock object. This is the parent address block. The cmdlet gets all the child IP address ranges for the parent address block.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByParent
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-NetworkId

Specifies an IP network prefix, in Classless InterDomain Routing (CIDR) notation.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNetworkId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StartIPAddress

Specifies an array of start addresses for IP address blocks.

Parameter properties

Type:

IPAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNetworkId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ThrottleLimit

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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.