Import-IpamAddress

Import-IpamAddress

Imports IP address into the IPAM server.

構文

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

詳細説明

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

パラメーター

-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. このパラメーターに対して使用できる値:

-- IPv4
-- IPv6

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

'Documents' folder of the user

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Force

ユーザーの確認を求めずにコマンドを強制的に実行します。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

MB

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Path<String>

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

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.

エイリアス

SI

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • None

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

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

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"

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

関連トピック

Export-IpamAddress