Export (0) Print
Expand All
Expand Minimize

Import-IpamAddress

Windows Server 2012 R2 and Windows 8.1

Updated: December 18, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Import-IpamAddress

Imports IP address into the IPAM server.

Syntax

Parameter Set: Import
Import-IpamAddress -AddressFamily <AddressFamily> -Path <String> [-AsJob] [-CimSession <CimSession[]> ] [-ErrorPath <String> ] [-Force] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InventoryImport
Import-IpamAddress -AddressFamily <AddressFamily> -ManagedByService <String> -NetworkId <String> -Path <String> -ServiceInstance <String> [-AddressSpace <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-EndIpAddress <IPAddress> ] [-ErrorPath <String> ] [-Force] [-NetworkType <VirtualizationType> ] [-StartIpAddress <IPAddress> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Import-IpamAddress cmdlet imports IP addresses from a comma-separated values (CSV) file into the IP Address Management (IPAM) server.

The cmdlet supports two parameter sets. The Import parameter set adds IP address objects from the CSV file into the IPAM server and updates the existing address objects with updated information specified in the CSV file.

Use the InventoryImport parameter set to periodically import and update all of the IP address objects that map to the IP address range that you specify by using the unique combination of the NetworkId, ManagedByService, ServiceInstance, StartIPAddress, and EndIPAddress parameters. In addition to adding new addresses and changing existing addresses, this operation also removes the addresses which map to the IP address range that you specify but do not exist in the .csv file that you import. The import and update operations of IP addresses for an IP address range succeed only if the range exists the IPAM server.

The only field required in the CSV file that you import is the IP address. Other address-specific fields or custom fields can be specified in any order in the import CSV file.

The IPAM Windows PowerShell import supports both the English and server localized .csv files. The IPAM server uses the presence of the field name IPAddress in the CSV file to determine that the file must be processed in English format. If the field name IPAddress is not present in the CSV file, the CSV file is processed in the server localized format for the field names and enumeration values. The format of date and time values of the imported objects are interpreted in the localized format of the computer that runs the IPAM server and not in Coordinated Universal Time (UTC).

Parameters

-AddressFamily<AddressFamily>

Specifies the address family of the IP address records in the import file. The IP address records in the CSV file must belong to the address family that you specify for this parameter. 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 the name of an address space. If you do not specify this parameter, the cmdlet imports the IP addresses into the Default address space. 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

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.


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

-EndIpAddress<IPAddress>

Specifies the end address for the IP address block. If you do not specify this parameter, the cmdlet uses the last IP address of the network that you specify for the NetworkId parameter. If you specify this parameter, you must specify the StartIPAddress parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ErrorPath<String>

Specifies the literal path of the error CSV files that IPAM generates if one or more IP address records fail to import.

The file name is generated automatically by the computer that runs the IPAM server by prepending 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

Forces the command to run without asking for user confirmation.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ManagedByService<String>

Specifies the value of the service that manages the IP address range for which you are importing and updating IP addresses. Specify this parameter and the ServiceInstance, NetworkId, StartIpAddress, and EndIpAddress parameters to uniquely identify a range.


Aliases

MB

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NetworkId<String>

Specifies an IPv4 or IPv6 network prefix, in Classless InterDomain Routing (CIDR) notation. This parameter specifies the IP subnet of the IP address range for which you import the addresses.

Specify this parameter and the ManagedByService, ServiceInstance, StartIpAddress, and EndIpAddress parameters to uniquely identify a range.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NetworkType<VirtualizationType>

Specifies an IPv4 or IPv6 network prefix, in Classless InterDomain Routing (CIDR) notation. This parameter specifies the IP subnet of the IP address range for which to export the addresses.

Specify this parameter and the ManagedByService, ServiceInstance, StartIpAddress, and EndIpAddress parameters to uniquely identify an address range.


Aliases

none

Required?

false

Position?

named

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?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ServiceInstance<String>

Specifies the value of the service instance of the IP address range for which you are importing and updating IP addresses. Specify this parameter and the ManagedByService, NetworkId, StartIpAddress, and EndIpAddress parameters to uniquely identify a range.


Aliases

SI

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-StartIpAddress<IPAddress>

Specifies the start address for the IP address block. If you do not specify this parameter, the cmdlet uses the first address of the network that you specify for the NetworkId parameter. If you specify this parameter, you must specify the EndIPAddress parameter.


Aliases

none

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

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

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 that the cmdlet performed. The message is one of the following:
    Import of <AddressFamily> objects is complete. <y> out of <y> objects successfully imported.
    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>


Examples

Example 1: Import IPv4 addresses

This command imports the IPv4 addresses from the file C:\Addressv4.csv into 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 command runs without user confirmation.


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

Example 2: Import IPv4 addresses and record errors

This command imports IPv4 addresses from the file C:\Addressv4.csv into the IPAM server. The command adds new addresses and modifies and existing addresses. The command records errors that occur during the import a CSV file at the path C:\. The command runs without user confirmation.


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

Example 3: Import and update IPv4 addresses in a range

This command imports and updates all of the IPv4 addresses from the specified path that belong to the range specified by the network ID 10.10.10.0/24, the managing service IPAM, and the service instance Localhost. The cmdlet calculates the start IP address as 10.10.10.1 and the end IP address as 10.10.10.254. The cmdlet adds new addresses, changes existing addresses, and removes addresses that belong to the specified range which are not in the CSV file. 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"
Confirm 
 
Imports a csv file as an update of all IP address records that belong to the specified IP address range. Along with adding new addresses and editing existing addresses, this operation also deletes addresses belonging to the specified IP address range from IPAM database, that are not present in the csv file update being imported. 
 
 
Continue with this operation? 
 
[Y] Yes  [N] No  [?] Help  :Y 

Example 4: Import and update IPv4 addresses that have a start and end address

This command imports and updates all of the IPv4 addresses from the file C:\Addressupdatev4.csv that belong to the range specified by the network ID 10.10.10.0/24, the start IP address 10.10.10.1, the end IP address 10.10.10.50, the managing service IPAM, and the service instance Localhost. The command adds new addresses, changes existing addresses, and removes addresses that belong to the specified range which are not in the CSV file. The command records errors that occur in CSV file in the Documents folder of the user.


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

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft