Export (0) Print
Expand All

Import-IpamRange

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Import-IpamRange

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

Syntax

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

Parameter Set: Inventory
Import-IpamRange [-ManagedByService] <String> [-ServiceInstance] <String> [-AddManagedByService] [-AddServiceInstance] [-DeleteMappedAddresses] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Import-IpamRange cmdlet imports IP address range objects from the specified comma-separated values (.csv) file into the computer running the IP Address Management (IPAM) server. The computer running the IPAM server does not support import of IP address ranges that have the ServiceInstance parameter value of MS DHCP, since this is reserved for DHCP scopes automatically discovered by the computer running the IPAM server from the managed computers running Microsoft DHCP server services. Any objects that fail being imported during the operation are logged in the appropriate error log file for further analysis.

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

The second parameter set can be used to periodically import and update all IP address range objects that belong to the specified unique combination of the ManagedByService and ServiceInstance parameters, in the computer running the IPAM server. Along with adding new ranges and editing existing ranges, this import operation also deletes those ranges from the computer running the IPAM server which have the same value as the ManagedByService and ServiceInstance parameters but are not present in the .csv file being imported. This parameter set further provides the option of deleting the IP addresses mapping to the IP address ranges that are deleted during import by using the DeleteMappedAddresses parameter.

The import and update of IP address ranges for the specified ManagedByService and ServiceInstance parameter values succeeds if these values are present in the computer running the IPAM server at the time of import. The AddManagedByService and AddServiceInstance can be used to create the specified ManagedByService and ServiceInstance parameter values within the computer running the IPAM server at run-time before the import operation, if required.

The only mandatory field required to be present in the .csv file being imported for IPAM ranges is the network identifier (ID) itself. Any other range specific basic field or custom field can be specified in any order in the .csv file for import. Sample format of 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 English as well as server localized .csv file. The computer running the IPAM server uses presence of the field named NetworkId (without spaces) in the .csv file to ascertain that the file must be processed in English format. Otherwise the 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

-AddManagedByService

Adds the specified ManagedByService parameter value to the custom field that matches this parameter name, if not already present.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AddressFamily<String>

Specifies the address family of 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 specified address.


Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AddServiceInstance

Adds the specified ServiceInstance parameter value to the custom field that matches this parameter name, if not already present.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DeleteMappedAddresses

Specifies that all of the IP addresses that belong, or map, to the IP address ranges being deleted during the import and update operation, are also deleted.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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.


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 ranges being imported and updated. Import of MS DHCP ranges is not supported by IPAM.


Aliases

none

Required?

true

Position?

4

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 ranges being imported and updated.


Aliases

none

Required?

true

Position?

5

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.

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 command. Message can be 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

This example imports IPv4 address ranges from the file C:\rangev4.csv into the computer running the IPAM server. The new ranges are added and existing ranges are edited. The errors, if any, are recorded in the Documents folder of the user in .csv file format. This example suppresses the default confirmation message.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangev4.csv" -Force

EXAMPLE 2

This example imports IPv4 address ranges from the file C:\rangev4.csv into the computer running the IPAM server. The new ranges are added and existing ranges are edited. The errors, if any, are recorded in .csv file format at the path C:\. This example suppresses the default confirmation message.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangev4.csv" -ErrorPath "C:\" -Force

EXAMPLE 3

This example imports and updates all of the IPv4 address ranges managed by the service IPAM and service instance Localhost, from the file C:\rangeupdatev4.csv into IPAM. The new ranges are added, existing ranges are edited, and ranges belonging to the specified combination of the ManagedByService and ServiceInstance parameters, 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.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangeupdatev4.csv" -ManagedByService "IPAM" -ServiceInstance "localhost"
Confirm 
 
Imports a csv file as an update of all IP address ranges that belong to the specified combination of ManagedByService and ServiceInstance values. Along with adding new ranges and editing existing ranges, this operation also deletes ranges belonging to the specified combination of ManagedByService and ServiceInstance from IPAM database, that are not present in the csv file being imported. 
Continue with this operation? 
 
[Y] Yes  [N] No  [?] Help  <default is "Y">:Y 

EXAMPLE 4

This example imports and updates all of the IPv4 address ranges with managing service IPAM and service instance Localhost, from the file C:\rangeupdatev4.csv into the computer running the IPAM server. The new ranges are added, existing ranges are edited, and ranges belonging to the specified combination of the ManagedByService and ServiceInstance parameters, which are not in the .csv file, are deleted from the computer running the IPAM server. The errors, if any, are recorded in .csv file format at the path C:\. This example suppresses the default confirmation message.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangeupdatev4.csv" -ManagedByService "IPAM" -ServiceInstance "localhost" -ErrorPath "C:\" -Force

EXAMPLE 5

This example adds DHCPServer1 as a new value of the custom field ServiceInstance, if this value is not already present in the computer running the IPAM server. This cmdlet imports and updates all of the IPv4 address ranges with managing service Others and service instance DHCPServer1, from the file C:\rangeupdatev4.csv into the computer running the IPAM server. The new ranges are added, existing ranges are edited, and ranges belonging to the specified combination of the ManagedByService and ServiceInstance parameters, 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. This example suppresses the default confirmation message.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangeupdatev4.csv" -ManagedByService "Others" -ServiceInstance "DHCPServer1" –AddServiceInstance -Force

EXAMPLE 6

This example adds DHCPServer1 as a new value of the custom field ServiceInstance, if this value is not already present in the computer running the IPAM server. This cmdlet also adds MyDHCPType as a new value of the custom field ManagedByService, if this value is not already present in the computer running the IPAM server. This cmdlet imports and updates all of the IPv4 address ranges with managing service MyDHCPType and service instance DHCPServer1, from the file C:\rangeupdatev4.csv into the computer running the IPAM server. The new ranges are added, existing ranges are edited, and ranges belonging to the specified combination of the ManagedByService and ServiceInstance parameters, 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. This example suppresses the default confirmation message.


PS C:\> Import-IpamRange -AddressFamily IPv4 -Path "C:\rangeupdatev4.csv" -ManagedByService "MyDHCPType" -ServiceInstance "DHCPServer1" -AddServiceInstance –AddManagedByService -Force

Related topics

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