Import-IpamRange

Windows Server 2012 R2 and Windows 8.1

Import-IpamRange

Imports one or more IP address range objects from the specified file into the computer running the IPAM server.

구문

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

Parameter Set: InventoryImport
Import-IpamRange -AddressFamily <AddressFamily> -ManagedByService <String> -Path <String> -ServiceInstance <String> [-AddManagedByService] [-AddServiceInstance] [-AsJob] [-CimSession <CimSession[]> ] [-CreateSubnetIfNotFound] [-DeleteMappedAddresses] [-ErrorPath <String> ] [-Force] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




자세한 설명

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.

매개 변수

-AddManagedByService

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


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-AddressFamily<AddressFamily>

Specifies the address family of records to import. 이 매개 변수에 허용되는 값은 다음과 같습니다. 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.


별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-AddServiceInstance

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


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-AsJob

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CimSession<CimSession[]>

원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.


별칭

Session

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-CreateSubnetIfNotFound

Indicates that the cmdlet creates a parent subnet for this range of addresses. If you specify this parameter, the cmdlet automatically creates a parent subnet for this range, if no parent subnet exists.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-DeleteMappedAddresses

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


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ErrorPath<String>

Specifies the fully qualified 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.


별칭

없음

필수 여부

false

위치

named

기본값

'Documents' folder of the user

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-Force

사용자 확인을 요구하지 않고 명령을 실행합니다.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

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.


별칭

MB

필수 여부

true

위치

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 an array of service instances that manage the address ranges to import.


별칭

SI

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

True (ByPropertyName)

와일드카드 문자 허용 여부

false

-ThrottleLimit<Int32>

이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.


별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.


필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • None

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

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


예제

Example 1: Import address ranges

This command imports IPv4 address ranges from the file named 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 command suppresses the default confirmation message.


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

Example 2: Import IPv4 address ranges and log errors

This command imports IPv4 address ranges from the file named 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 command also suppresses the default confirmation message, by using the Force parameter.


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

Example 3: Import and update address ranges

This command imports and updates all of the IPv4 address ranges managed by the IPAM service and the Localhost service instance, from the file named 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"

Example 4: Import and update address ranges and log errors

This command imports and updates all of the IPv4 address ranges with the managing service named IPAM and the service instance named Localhost, from the file named 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 command suppresses the default confirmation message.


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

Example 5: Import, update, and delete address ranges

This command 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 named 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 command suppresses the default confirmation message.


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

Example 6: Add a custom value and import address ranges

This command 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 named 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 command suppresses the default confirmation message.


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

관련 항목

커뮤니티 추가 항목

추가
표시: