Import-IpamAddress

Import-IpamAddress

Imports one or more IP address objects from the specified comma-separated values (.csv) file into the computer running the IP Address Management (IPAM) server.

Syntax

Parameter Set: List
Import-IpamAddress [-Path] <String> [-AddressFamily] <String> [-ErrorPath <String> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: Inventory
Import-IpamAddress [-Path] <String> [-AddressFamily] <String> [-ManagedByService] <String> [-ServiceInstance] <String> [-NetworkId] <String> [-EndIPAddress <IPAddress> ] [-ErrorPath <String> ] [-Force] [-StartIPAddress <IPAddress> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Import-IpamAddress cmdlet imports one or more IP address objects from the specified comma-separated values (.csv) file into the computer running the IP Address Management (IPAM) server. Any objects that fail being imported during the operation are logged in the appropriate error log file for further analysis.

The cmdlet supports two parameter sets. The default invocation of the cmdlet adds new IP address objects from the .csv file into the computer running the IPAM server and edits the existing address objects with updated information specified in the .csv file.

The second parameter set can be used to periodically import and update all of the IP address objects that belong ,or map, to the IP address range identified by the unique combination of the NetworkId, ManagedByService, ServiceInstance, StartIPAddress, and EndIPAddress parameters, in the computer running the IPAM server. Along with adding new addresses and editing existing addresses, this operation also deletes those addresses from the computer running the IPAM server which map to the specified IP address range, but are not present in the .csv file being imported. If not specified, then the computer running the IPAM server auto calculates the StartIPAddress and EndIPAddress parameter values, at the default address boundaries of the range as specified by the NetworkId parameter. If explicitly specified, then both the StartIpAddress and EndIpAddress parameter values must be provided together. The import and update operation of IP addresses for the IP address range succeeds only if the range is already present in the computer running the IPAM server at the time of import.

The only mandatory field required to be present in the .csv file being imported for IPAM addresses is the IP address itself. Any other address specific basic field or custom field can be specified in any order in the .csv file for import. Sample format of the import .csv file, can be generated using IPAM export functionality from IPAM UI (localized format) or IPAM Windows PowerShell® (English format).

Note: The IPAM Windows PowerShell import supports both the English as well as the server localized .csv file. The computer running the IPAM server uses the presence of the field name IPAddress (without spaces) in the .csv file to determine that the file must be processed in English format. Otherwise the .csv file is processed in the server localized format for the various field names and enumeration values. The format of date and time values of the imported objects are always interpreted in the localized format of the computer running the IPAM server and not in UTC.

Parameters

-AddressFamily<String>

Specifies the address family of the records being imported. The acceptable values for this parameter are: IPv4 or IPv6. Only one address family at a time can be specified with this cmdlet and the records in the .csv file should match the address family specified by this parameter.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-EndIPAddress<IPAddress>

Specifies the ending IP address of the IP address range for which the addresses are being imported. This parameter uniquely identifies a range along with the values of the ManagedByService, ServiceInstance, NetworkId, and StartIpAddress parameters. The default value of this parameter aligns to the end of the address range as specified by the NetworkId parameter; but for IPv4 networks, a host ID of all ones (1) is not used while calculating the default starting IP address. An example with a default starting IP address for an IPv4 network auto-calculates the value for this parameter to be 220.0.0.254 for the NetworkId parameter value of 220.0.0.0/24. Both the StartIpAddress parameter and this parameter must be explicitly specified together. This parameter must fall within the subnet specified by the NetworkId parameter.

Aliases

none

Required?

false

Position?

named

Default Value

End address of the valid address range specified by NetworkId

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ErrorPath<String>

Specifies the literal path, and not the name, of the error .csv file which are created if one or more records fail to get imported.
The file name is generated automatically by the computer running the IPAM server by pre-pending Error_ and appending the timestamp of the operation to the file name specified in the Path parameter. The default value of this parameter is the Documents folder of the user.

Aliases

none

Required?

false

Position?

named

Default Value

'Documents' folder of the user

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Force

Suppresses the default confirmation text. This parameter can be used with this cmdlet, to suppress the default confirmation text for the cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ManagedByService<String>

Specifies the value of the managing service of the IP address range for which the addresses are being imported and updated. This parameter uniquely identifies a range along with the values of the ServiceInstance, NetworkId, StartIpAddress, and EndIpAddress parameters.

Aliases

none

Required?

true

Position?

4

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NetworkId<String>

Specifies the IP subnet of the IP address range for which addresses are being imported in the format: <Subnet Id>/<Prefix Length> such as 220.0.0.0/24. This parameter uniquely identifies a range along with the values of the ManagedByService, ServiceInstance, StartIpAddress, and EndIpAddress parameters. This parameter is used to determine the default values of the StartIpAddress and EndIpAddress parameters unless explicitly specified.

Aliases

none

Required?

true

Position?

6

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Path<String>

Specifies the literal path and name of the .csv file to import.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServiceInstance<String>

Specifies the value of the service instance of the IP address range for which the addresses are being imported and updated. This parameter uniquely identifies a range along with the values of the ManagedByService, NetworkId, StartIpAddress, and EndIpAddress parameters.

Aliases

none

Required?

true

Position?

5

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-StartIPAddress<IPAddress>

Specifies the starting IP address of the IP address range for which the addresses are being imported. This parameter uniquely identifies a range along with the value of the ManagedByService, ServiceInstance, NetworkId, and EndIpAddress parameters. The default value of this parameter aligns to the start of the address range as specified by the NetworkId parameter; but for IPv4 networks, a host ID of all zeros (0) is not used while calculating the default start IP address. An example with a default starting IP address for an IPv4 network auto-calculates the value for this parameter to be 220.0.0.1 for the NetworkId parameter value of 220.0.0.0/24. Both the StartIpAddress and EndIpAddress parameters must be explicitly specified together. This parameter must fall within the subnet specified by the NetworkId parameter.

Aliases

none

Required?

false

Position?

named

Default Value

Start address of the valid address range specified by NetworkId

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.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.String

    A detailed summary of the steps performed by this cmdlet. The message can be one of the following:
    Import of <AddressFamily> objects is complete. <y> out of <y> objects successfully imported.<AddressFamily><y><y>
    OR
    Import of <AddressFamily> objects is complete. <x> out of <y> objects successfully imported. <z> out of <y> objects failed to get imported. Failures recorded in the file: <ErrorFilename><AddressFamily><x><y><z><y><ErrorFilename>

Examples

EXAMPLE 1

This example imports the IPv4 addresses from the file C:\addressv4.csv into the computer running the IPAM server. The new addresses are added and existing addresses are edited. The errors, if any, are recorded in the Documents folder of the user in .csv file format. The default confirmation text is suppressed in this example.

PS C:\> Import-IpamAddress -AddressFamily IPv4 -Path "C:\addressv4.csv" -Force

EXAMPLE 2

This example imports IPv4 addresses from the file C:\addressv4.csv into the computer running the IPAM server. The new addresses are added and existing addresses are edited. The errors, if any, are recorded in .csv file format at the path C:\. The default confirmation text is suppressed in this example.

PS C:\> Import-IpamAddress -AddressFamily IPv4 -Path "C:\addressv4.csv" -ErrorPath "C:\" -Force

EXAMPLE 3

This example imports and updates all of the IPv4 addresses belonging to the range specified by the network ID 10.10.10.0/24, the managing service IPAM, and the service instance Localhost, from the file C:\addressupdatev4.csv into the computer running the IPAM server. The starting IP address and ending IP address of the range are automatically calculated as 10.10.10.1 and 10.10.10.254 respectively since the values are not explicitly specified. The new addresses are added, existing addresses are edited, and addresses belonging to the specified range, which are not in the .csv file, are deleted from the computer running the IPAM server. The errors, if any, are recorded in the documents folder of the user in .csv file format. Note: By default, host IDs that contain all zeros (0) and all ones (1) are skipped for IPv4 address ranges while calculating the starting and ending IP address.

PS C:\> Import-IpamAddress -AddressFamily IPv4 -Path "C:\addressupdatev4.csv" -ManagedByService "IPAM" -ServiceInstance "localhost" -NetworkId 10.10.10.0/24

EXAMPLE 4

This example imports and updates all of the IPv4 addresses belonging to the range specified by the network ID 10.10.10.0/24, the starting IP address 10.10.10.1, the ending IP address 10.10.10.50, the managing service IPAM, and the service instance Localhost, from the file C:\addressupdatev4.csv into the computer running the IPAM server. The new addresses are added, existing addresses are edited, and addresses belonging to the specified range, which are not in the .csv file, are deleted from the computer running the IPAM server. The errors, if any, are recorded in the Documents folder of the user in .csv file format. The default confirmation text is suppressed in this example.

PS C:\> Import-IpamAddress -AddressFamily IPv4 -Path "C:\addressupdatev4.csv" -ManagedByService "IPAM" -ServiceInstance "localhost" -NetworkId 10.10.10.0/24 -StartIpAddress 10.10.10.1 -EndIpAddress 10.10.10.50 -Force

Export-IpamAddress