Skip to content

New-NBIPAMAddress

Since

v1.0.4

SYNOPSIS

Creates one or more IP addresses in Netbox IPAM module.

SYNTAX

Single (Default)

New-NBIPAMAddress -Address <String> [-Status <String>] [-Tenant <UInt64>] [-VRF <UInt64>] [-Role <String>]
 [-NAT_Inside <UInt64>] [-Custom_Fields <Hashtable>] [-Interface <UInt64>] [-Description <String>]
 [-Dns_name <String>] [-Assigned_Object_Type <String>] [-Assigned_Object_Id <UInt64>] [-Owner <UInt64>]
 [-Tags <Object[]>] [-Raw] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

Bulk

New-NBIPAMAddress -InputObject <PSObject> [-BatchSize <Int32>] [-Force] [-Tags <Object[]>] [-Raw]
 [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Creates new IP addresses in Netbox IPAM module. Supports both single IP creation with individual parameters and bulk creation via pipeline input.

For bulk operations, use the -BatchSize parameter to control how many addresses are sent per API request. This significantly improves performance when creating many IP addresses.

EXAMPLES

EXAMPLE 1

New-NBIPAMAddress -Address "192.168.1.1/24"

Creates a single IP address with status active.

EXAMPLE 2

New-NBIPAMAddress -Address "10.0.0.1/24" -Status active -Description "Gateway"

Creates an IP address with description.

EXAMPLE 3

1..254 | ForEach-Object {
    [PSCustomObject]@{
        Address = "192.168.1.$_/24"
        Status = "active"
        Description = "Host $_"
    }
} | New-NBIPAMAddress -BatchSize 100 -Force

Bulk create 254 IP addresses in a subnet.

EXAMPLE 4

Import-Csv ips.csv | New-NBIPAMAddress -BatchSize 50 -Force

Bulk import IP addresses from CSV file.

PARAMETERS

-Address

IP address in CIDR notation: 192.168.1.1/24. Required for single mode.

Type: String
Parameter Sets: Single
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Status

Status of the IP. Defaults to 'Active'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: Active
Accept pipeline input: False
Accept wildcard characters: False

-Tenant

Tenant ID.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-VRF

VRF ID.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Role

Role such as anycast, loopback, etc.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NAT_Inside

ID of IP for NAT.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Custom_Fields

Custom field hash table. Will be validated by the API service.

Type: Hashtable
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Interface

ID of interface to apply IP (deprecated, use Assigned_Object_Id).

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Description

Description of IP address.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Dns_name

DNS Name of IP address (example: netbox.example.com).

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Assigned_Object_Type

Assigned Object Type: 'dcim.interface' or 'virtualization.vminterface'.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Assigned_Object_Id

Assigned Object ID.

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Owner

The owner ID for object ownership (Netbox 4.5+ only).

Type: UInt64
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Pipeline input for bulk operations. Each object should contain at minimum the Address property.

Type: PSObject
Parameter Sets: Bulk
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-BatchSize

Number of IP addresses to create per API request in bulk mode. Default: 50, Range: 1-1000

Type: Int32
Parameter Sets: Bulk
Aliases:

Required: False
Position: Named
Default value: 100
Accept pipeline input: False
Accept wildcard characters: False

-Force

Skip confirmation prompts for bulk operations.

Type: SwitchParameter
Parameter Sets: Bulk
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Tags

One or more tags to assign to this object (tag names or IDs).

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Raw

Return the raw API response instead of the results array.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Management.Automation.PSObject

NOTES

AddedInVersion: v1.0.4

Common parameters

common request params
common bulk params

https://netbox.readthedocs.io/en/stable/models/ipam/ipaddress/