Skip to content

Get-NBTenantGroup

Since

v4.4.10.0

SYNOPSIS

Retrieves tenant groups from Netbox.

SYNTAX

Query (Default)

Get-NBTenantGroup [-All] [-PageSize <Int32>] [-Brief] [-Fields <String[]>] [-Omit <String[]>] [-Name <String>] [-Slug <String>] [-Description <String>] [-Parent_Id <UInt64>] [-Query <String>] [-Limit <UInt16>] [-Offset <UInt16>] [-Raw] [-ProgressAction <ActionPreference>] [<CommonParameters>]

ByID

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

DESCRIPTION

Retrieves tenant groups from the Netbox tenancy module. Tenant groups are organizational containers for grouping related tenants.

EXAMPLES

EXAMPLE 1

Get-NBTenantGroup

Returns all tenant groups.

EXAMPLE 2

Get-NBTenantGroup -Name "Enterprise*"

Returns tenant groups matching the name pattern.

EXAMPLE 3

Get-NBTenantGroup -Id 1

Returns the tenant group with ID 1.

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

-Id

Database ID(s) of the tenant group to retrieve. Accepts pipeline input.

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

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

-Name

Filter by tenant group name.

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

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

-Slug

Filter by tenant group slug.

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

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

-Description

Filter by description.

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

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

-Parent_Id

Filter by parent tenant group ID.

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

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

-Query

General search query.

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

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

Common parameters

common request params
common pagination params

https://netbox.readthedocs.io/en/stable/models/tenancy/tenantgroup/