Skip to content

Get-NBIPAMPrefix

Since

v1.0.4

SYNOPSIS

Retrieves IP prefixes from Netbox IPAM module.

SYNTAX

Query (Default)

Get-NBIPAMPrefix [-All] [-PageSize <Int32>] [-Brief] [-Fields <String[]>] [-Omit <String[]>] [[-Prefix] <String>] [-Query <String>] [-Family <Int32>] [-Is_Pool <Boolean>] [-Within <String>] [-Within_Include <String>] [-Contains <String>] [-Mask_Length <Byte>] [-VRF <String>] [-VRF_Id <UInt64>] [-Tenant <String>] [-Tenant_Id <UInt64>] [-Scope_Type <String>] [-Scope_Id <UInt64>] [-Vlan_VId <String>] [-Vlan_Id <UInt64>] [-Status <String>] [-Role <String>] [-Role_Id <UInt64>] [-Limit <UInt16>] [-Offset <UInt16>] [-Raw] [-ProgressAction <ActionPreference>] [<CommonParameters>]

ByID

Get-NBIPAMPrefix [-All] [-PageSize <Int32>] [-Brief] [-Fields <String[]>] [-Omit <String[]>] [-Id <UInt64[]>] [-Limit <UInt16>] [-Offset <UInt16>] [-Raw] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Retrieves IP prefix objects from Netbox. Prefixes represent IP network ranges (IPv4 or IPv6) and can be organized hierarchically within VRFs.

EXAMPLES

EXAMPLE 1

Get-NBIPAMPrefix

EXAMPLE 2

Get-NBIPAMPrefix -Omit 'description','comments' Returns prefixes without description and comments fields (Netbox 4.5+).

PARAMETERS

-All

Automatically fetch all pages of results. Uses the API's pagination to retrieve all items across multiple requests.

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

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

-PageSize

Number of items per page when using -All. Default: 100. Range: 1-1000.

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

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

-Brief

Return a minimal representation of objects (id, url, display, name only). Reduces response size by ~90%. Ideal for dropdowns and reference lists.

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

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

-Fields

Specify which fields to include in the response. Supports nested field selection (e.g., 'site.name', 'device_type.model').

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

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

-Omit

Specify which fields to exclude from the response. Requires Netbox 4.5.0 or later.

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

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

-Prefix

{{ Fill Prefix Description }}

```yaml Type: String Parameter Sets: Query Aliases:

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

-Query

General search query to match prefixes.

```yaml Type: String Parameter Sets: Query Aliases:

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

-Id

Database ID of the prefix.

```yaml Type: UInt64[] Parameter Sets: ByID Aliases:

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

-Family

IP address family (4 for IPv4, 6 for IPv6).

```yaml Type: Int32 Parameter Sets: Query Aliases:

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

-Is_Pool

Filter for prefixes marked as IP pools.

```yaml Type: Boolean Parameter Sets: Query Aliases:

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

-Within

Return prefixes within a parent prefix (CIDR notation, e.g., '10.0.0.0/16').

```yaml Type: String Parameter Sets: Query Aliases:

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

-Within_Include

Return prefixes within or equal to a prefix (CIDR notation, e.g., '10.0.0.0/16').

```yaml Type: String Parameter Sets: Query Aliases:

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

-Contains

Return prefixes containing an IP or subnet.

```yaml Type: String Parameter Sets: Query Aliases:

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

-Mask_Length

CIDR mask length value.

```yaml Type: Byte Parameter Sets: Query Aliases:

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

-VRF

Filter by VRF name.

```yaml Type: String Parameter Sets: Query Aliases:

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

-VRF_Id

Filter by VRF database ID.

```yaml Type: UInt64 Parameter Sets: Query Aliases:

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

-Tenant

Filter by tenant name.

```yaml Type: String Parameter Sets: Query Aliases:

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

-Tenant_Id

Filter by tenant database ID.

```yaml Type: UInt64 Parameter Sets: Query Aliases:

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

-Scope_Type

Filter by scope type (e.g., 'dcim.site', 'dcim.region', 'dcim.sitegroup', 'dcim.location').

```yaml Type: String Parameter Sets: Query Aliases:

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

-Scope_Id

Filter by scope object database ID.

```yaml Type: UInt64 Parameter Sets: Query Aliases:

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

-Vlan_VId

Filter by VLAN ID number.

```yaml Type: String Parameter Sets: Query Aliases:

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

-Vlan_Id

Filter by VLAN database ID.

```yaml Type: UInt64 Parameter Sets: Query Aliases:

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

-Status

Filter by prefix status (e.g., 'active', 'reserved', 'deprecated').

```yaml Type: String Parameter Sets: Query Aliases:

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

-Role

Filter by IPAM role name.

```yaml Type: String Parameter Sets: Query Aliases:

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

-Role_Id

Filter by IPAM role database ID.

```yaml Type: UInt64 Parameter Sets: Query Aliases:

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

-Limit

Maximum number of results to return (1-1000).

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

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

-Offset

Number of results to skip for pagination.

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

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

-Raw

Return the raw API response instead of extracting the results array.

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

Required: False Position: Named Default value: False 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: v1.0.4 The -Brief, -Fields, and -Omit parameters are mutually exclusive.

Common parameters

common request params
common pagination params