Get-IpamAddress
Get-IpamAddress
Gets IP addresses from IPAM.
Syntax
Parameter Set: ByAddress
Get-IpamAddress [-IpAddress] <IPAddress[]> [-AddressSpace <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-ManagedByService <String[]> ] [-NetworkType <VirtualizationType[]> ] [-ServiceInstance <String[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByAddressFamily
Get-IpamAddress -AddressFamily <AddressFamily[]> [-AddressCategory <AddressCategory[]> ] [-AddressSpace <String[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-ManagedByService <String[]> ] [-NetworkType <VirtualizationType[]> ] [-ServiceInstance <String[]> ] [-ThrottleLimit <Int32> ] [-Unmapped] [ <CommonParameters>]
Parameter Set: ByBlock
Get-IpamAddress -MappingToBlock <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByRange
Get-IpamAddress -MappingToRange <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: BySubnet
Get-IpamAddress -MappingToSubnet <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Detailed Description
The Get-IpamAddress cmdlet gets IP addresses from IP Address Management (IPAM). Specify the IpAddress parameter to retrieve an IP address. Specify the AddressFamily parameter to retrieve a set of IP addresses for address families. You can also get addresses that belong to a range, a subnet, or an address block.
Parameters
-AddressCategory<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
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-AddressFamily<AddressFamily[]>
Specifies an array of address families of IP addresses. The acceptable values for this parameter are:
-- IPv4
-- IPv6
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-AddressSpace<String[]>
Specifies an array of names of address spaces. If you do not specify this parameter, the cmdlet gets the addresses for all address spaces in IPAM. If you specify this parameter, you must specify the AddressFamily parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
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 |
-IpAddress<IPAddress[]>
Specifies an array of IP addresses.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ManagedByService<String[]>
Specifies an array of names of the services that manage the IP addresses. The values that you specify for this parameter must exist in the set of values that you defined for the ManagedByService custom field in IPAM.
You can use the Add-IpamCustomValue to add a value to the ManagedByService custom field in IPAM. You can use the Remove-IpamCustomValue to remove a value from the ManagedByService custom field in IPAM.
Aliases |
MB |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-MappingToBlock<CimInstance>
Specifies an IP block. The cmdlet gets the addresses that belong to the IP block.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-MappingToRange<CimInstance>
Specifies an IP address range. The cmdlet retrieves the addresses that belong to the IP range.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-MappingToSubnet<CimInstance>
Specifies an IP subnet. The cmdlet retrieves the addresses that belong to the IP subnet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-NetworkType<VirtualizationType[]>
Specifies the network type of the address. The acceptable values for this parameter are:
-- Provider
-- Customer
-- NonVirtualized
The default value is NonVirtualized.
If you specify Default for the AddressSpace parameter, the valid values for this parameter are Provider and NonVirtualized. If you specify a provider type of address space for the AddressSpace parameter, you must specify Provider for this parameter. If you specify a customer type of address space for the AddressSpace parameter, you must specify Customer for this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ServiceInstance<String[]>
Specifies an array of instances of the services that manage the IP addresses. Specify the instances of the service that you specified for the ManagedByService parameter. The value that you specify for this parameter must exist in the set of values that you defined for the ServiceInstance custom field in IPAM.
Aliases |
SI |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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 |
-Unmapped
Indicates that the cmdlet gets addresses that do not belong to any address families of IP addresses in IPAM.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
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.
IpamAddress[]
Represents a set of IP addresses on the IPAM server.
Examples
Example 1: Get all private physical IPv4 addresses
This command gets all private physical IPv4 addresses in IPAM. Because the command specifies the Default address space, the command gets provider or non-virtualized IP addresses from all address spaces in IPAM.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressCategory Private -AddressSpace "Default"
Example 2: Get private IPv4 addresses for provider networks
This command gets all private IPv4 addresses for provider networks. Because the command does not specify the AddressSpace parameter, the command gets addresses that belong to all address spaces in IPAM.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressCategory Private -NetworkType Provider
Example 3: Get private IPv4 addresses from the default address space
This command gets all private IPv4 addresses for provider networks. Because the command specifies the Default address space, the command gets IP addresses from all address spaces configured in IPAM.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressCategory Private -NetworkType Provider -AddressSpace "Default"
Example 4: Get private IPv4 addresses for customer networks
This command gets all private IPv4 addresses for customer networks. Because the command does not specify the AddressSpace parameter, the command gets addresses that belong to all address spaces configured in IPAM.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressCategory Private -NetworkType Customer
Example 5: Get private IPv4 addresses for customer networks from an address space
This command gets all private IPv4 addresses for customer networks that belong to the address space named ContosoAddSpace01.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressCategory Private -NetworkType Customer -AddressSpace "ContosoAddSpace01"
Example 6: Get physical IP addresses from all address spaces
This command gets the physical IP addresses 10.12.1.1 and 10.12.3.1. Because the command does not specify the AddressSpace parameter, the command gets IP addresses from all address spaces which match the IP address 10.12.1.1 and 10.12.3.1.
PS C:\> Get-IpamAddress -IpAddress 10.12.1.1, 10.12.3.1
Example 7: Get duplicate addresses in an address space
This command gets all duplicate IPv4 addresses in the default provider address space. The Default address space is the address space to which the IPAM entity belongs. The command returns two addresses that have the address IP 172.16.10.16. One address is managed by IPAM and the other address is managed by . The IPAM server marks both these addresses as duplicate. 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
.
PS C:\> Get-IpamAddress -AddressFamily IPv4 -AddressSpace Default | Where-Object {$_.duplicate -eq $true} | Format-List IPAddress, NetworkType, ManagedByService, ServiceInstance, ProviderAddressSpace
Example 8: Get IP addresses that map to a subnet
This example gets all IP addresses that map to a subnet. Because the network type of the subnet is non-virtualized, the result contains only physical addresses and the fabric addresses from the default address space which belong to the subnet.
The first command uses the Get-IpamSubnet cmdlet to get the IpamSubnet object that contain subnets configured in IPAM for the network that has the ID 10.12.0.0/16. The command stores the object in the $ContosoPhysicalSubnet variable.
The second command gets all the IP addresses that belong to the IP subnet stored in the $ContosoPhysicalSubnet variable.
PS C:\> $ContosoPhysicalSubnet = Get-IpamSubnet -NetworkId "10.12.0.0/16"PS C:\>Get-IpamAddress -MappingToSubnet $ContosoPhysicalSubnet
Example 9: Get all IP address that map to a an IP range
This example gets all IP addresses that belong to a range of IP addresses.
The first command uses the Get-IpamRange cmdlet to get an IpamRange object that contains an IP range configured in IPAM. The command stores the object in the $Range variable.
The second command gets all the IP addresses that belong to the range stored in the $Range variable.
PS C:\> $Range = Get-IpamRange -StartIPAddress 10.12.1.1 -EndIPAddress 10.12.1.254 PS C:\>Get-IpamAddress -MappingToRange $Range