Skip to content

New-NBDCIMFrontPort

Since

v4.4.7

SYNOPSIS

Creates a new front port on a device in Netbox.

SYNTAX

New-NBDCIMFrontPort [-Device] <UInt64> [-Name] <String> [-Type] <String> [[-Rear_Ports] <PSObject[]>] [[-Rear_Port] <UInt64>] [[-Module] <UInt64>] [[-Label] <String>] [[-Color] <String>] [[-Rear_Port_Position] <UInt16>] [[-Description] <String>] [[-Mark_Connected] <Boolean>] [[-Tags] <UInt64[]>] [-Raw] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Creates a new front port on a specified device in the Netbox DCIM module. Front ports represent the front-facing ports on patch panels or other devices that connect to rear ports for pass-through cabling.

NOTE: Netbox 4.5+ uses a new port mapping model. The Rear_Port and Rear_Port_Position parameters are deprecated on 4.5+ and will be automatically converted to the new Rear_Ports array format.

EXAMPLES

EXAMPLE 1

New-NBDCIMFrontPort -Device 42 -Name "Port 1" -Type "8p8c" -Rear_Port 100

Creates a new RJ-45 front port named 'Port 1' on device 42, mapped to rear port 100. Works on both Netbox 4.4 and 4.5+ (auto-converts on 4.5+).

EXAMPLE 2

New-NBDCIMFrontPort -Device 42 -Name "Port 1" -Type "8p8c" -Rear_Ports @( @{ rear_port = 100; rear_port_position = 1 } )

Creates a front port using the new Netbox 4.5+ port mapping format.

EXAMPLE 3

New-NBDCIMFrontPort -Device 42 -Name "Fiber-01" -Type "lc" -Rear_Ports @( @{ rear_port = 100; rear_port_position = 1; position = 1 }, @{ rear_port = 101; rear_port_position = 1; position = 2 } )

Creates a front port with multiple rear port mappings (fiber pair swapping).

PARAMETERS

-Device

The database ID of the device to add the front port to.

```yaml Type: UInt64 Parameter Sets: (All) Aliases:

Required: True Position: 1 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```

-Name

The name of the front port (e.g., 'Port 1', 'Front-01').

```yaml Type: String Parameter Sets: (All) Aliases:

Required: True Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ```

-Type

The connector type of the front port. Common types include: - Copper: '8p8c' (RJ-45), '8p6c', '8p4c', '110-punch', 'bnc' - Fiber: 'lc', 'lc-apc', 'sc', 'sc-apc', 'st', 'mpo', 'mtrj' - Coax: 'f', 'n', 'bnc' - Other: 'splice', 'other'

```yaml Type: String Parameter Sets: (All) Aliases:

Required: True Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ```

-Rear_Ports

Array of rear port mappings for Netbox 4.5+. Each mapping should be a hashtable or PSCustomObject with the following properties: - rear_port: (Required) The database ID of the rear port - rear_port_position: (Optional) Position on the rear port (1-1024) - position: (Optional) Position on the front port (defaults to 1)

```yaml Type: PSObject[] Parameter Sets: (All) Aliases:

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

-Rear_Port

DEPRECATED on Netbox 4.5+. Use Rear_Ports instead. The database ID of the rear port that this front port maps to. On Netbox 4.5+, this will be automatically converted to Rear_Ports format.

```yaml Type: UInt64 Parameter Sets: (All) Aliases:

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

-Module

The database ID of the module within the device (for modular devices).

```yaml Type: UInt64 Parameter Sets: (All) Aliases:

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

-Label

A physical label for the port (what's printed on the device).

```yaml Type: String Parameter Sets: (All) Aliases:

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

-Color

The color of the port in 6-character hex format (e.g., 'ff0000' for red).

```yaml Type: String Parameter Sets: (All) Aliases:

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

-Rear_Port_Position

DEPRECATED on Netbox 4.5+. Use Rear_Ports instead. The position on the rear port (for rear ports with multiple positions). Defaults to 1 if not specified.

```yaml Type: UInt16 Parameter Sets: (All) Aliases:

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

-Description

A description of the front port.

```yaml Type: String Parameter Sets: (All) Aliases:

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

-Mark_Connected

Whether to mark this port as connected even without a cable object.

```yaml Type: Boolean Parameter Sets: (All) Aliases:

Required: False Position: 11 Default value: False Accept pipeline input: False Accept wildcard characters: False ```

-Tags

Array of tag IDs to assign to this front port.

```yaml Type: UInt64[] Parameter Sets: (All) Aliases:

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

-Raw

{{ Fill Raw Description }}

```yaml 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.

```yaml 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.

```yaml 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 }}

```yaml 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: v4.4.7

Common parameters

common request params

https://netbox.readthedocs.io/en/stable/models/dcim/frontport/