Skip to content

Set-NBIPAMAddress

Since

v1.0.4

SYNOPSIS

Updates one or more IP addresses in Netbox IPAM module.

SYNTAX

Single (Default)

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

Bulk

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

DESCRIPTION

Updates existing IP addresses in Netbox IPAM module. Supports both single IP address updates with individual parameters and bulk updates via pipeline input.

For bulk operations, use the -BatchSize parameter to control how many IP addresses are sent per API request. Each object must have an Id property.

EXAMPLES

EXAMPLE 1

Set-NBIPAMAddress -Id 123 -Status "active"

Updates IP address 123 to active status.

EXAMPLE 2

Get-NBIPAMAddress -Status "deprecated" | ForEach-Object {
    [PSCustomObject]@{Id = $_.id; Status = "reserved"}
} | Set-NBIPAMAddress -Force

Bulk update all deprecated IP addresses to reserved status.

EXAMPLE 3

$updates = @(
    [PSCustomObject]@{Id = 100; Description = "Updated"; Dns_name = "server1.local"}
    [PSCustomObject]@{Id = 101; Description = "Updated"; Dns_name = "server2.local"}
)
$updates | Set-NBIPAMAddress -BatchSize 50 -Force

Bulk update multiple IP addresses with different values.

PARAMETERS

-Id

The database ID of the IP address to update. Required for single updates.

Type: UInt64
Parameter Sets: Single
Aliases:

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

-Address

The IP address with prefix (e.g., "192.168.1.1/24").

Type: String
Parameter Sets: Single
Aliases:

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

-Status

Status of the IP address (e.g., "active", "reserved", "deprecated").

Type: String
Parameter Sets: Single
Aliases:

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

-Tenant

The tenant ID.

Type: UInt64
Parameter Sets: Single
Aliases:

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

-VRF

The VRF ID.

Type: UInt64
Parameter Sets: Single
Aliases:

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

-Role

The role of the IP address.

Type: String
Parameter Sets: Single
Aliases:

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

-NAT_Inside

The ID of the inside NAT IP address.

Type: UInt64
Parameter Sets: Single
Aliases:

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

-Custom_Fields

Hashtable of custom field values.

Type: Hashtable
Parameter Sets: Single
Aliases:

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

-Assigned_Object_Type

The type of object assigned to this IP (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

The ID of the assigned object.

Type: UInt64
Parameter Sets: Single
Aliases:

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

-Description

Description of the IP address.

Type: String
Parameter Sets: Single
Aliases:

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

-Dns_name

DNS name for the IP address.

Type: String
Parameter Sets: Single
Aliases:

Required: False
Position: Named
Default value: None
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 MUST have an Id 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 update 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.

Type: SwitchParameter
Parameter Sets: (All)
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

https://netbox.readthedocs.io/en/stable/rest-api/overview/