Import-IpamAddress

Import-IpamAddress

Imports IP address into the IPAM server.

Sintaxis

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

Descripción detallada

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

Parámetros

-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. Los valores aceptables para este parámetro son los siguientes:

-- IPv4
-- IPv6

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

'Documents' folder of the user

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Force

Fuerza que el comando se ejecute sin pedir confirmación al usuario.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

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.

Alias

MB

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-Path<String>

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

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue)

¿Aceptar caracteres comodín?

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.

Alias

SI

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

  • None

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

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

Ejemplos

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

Temas relacionados

Export-IpamAddress