Share via


Get-NAVCompany

Gets a list of the Business Central companies in the specified tenant database.

Syntax

Get-NAVCompany
    [-ServerInstance] <String>
    [[-Tenant] <TenantId>]
    [-IncludePartiallyDeleted]
    [-Force]
    [<CommonParameters>]

FileSet

Get-NAVCompany
    -FilePath <String>
    [-IncludePartiallyDeleted]
    [-Force]
    [<CommonParameters>]

Description

Use the Get-NAVCompany cmdlet to extract a list of companies in the specified database. In the Business Central Administration Shell, you can create, rename, and remove companies by using the New-NAVCompany, Rename-NAVCompany, and Remove-NAVCompany cmdlets. The following information is returned for each company: Company name, Evaluation Company

Examples

EXAMPLE 1

Get-NAVCompany -ServerInstance BC -Tenant CRONUS

This example shows a list of companies in the tenant database that has the tenant ID CRONUS and which is mounted against the BC server instance.

EXAMPLE 2

Get-NAVCompany -FilePath c:\file\my-exported.navdata

This example shows a list of companies that are contained in the my-exported.navdata file that is located in the c:\file folder.

Parameters

-FilePath

Specifies the path and name of the exported file that you want to get the company information from.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:FileName

Parameter sets

FileSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludePartiallyDeleted

Specifies to list companies that are not yet completely deleted.

This parameter only applies when the Business Central Server instance is configured to delete companies incrementally, in which case, the final stage of the company removal (deleting the data) is done by task scheduler.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServerInstance

Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NavServerSet
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Tenant

Specifies the ID of the tenant that the company is stored in, such as Tenant1. This parameter is required unless the specified service instance is not configured to run multiple tenants.

Parameter properties

Type:TenantId
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Id

Parameter sets

NavServerSet
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

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

Inputs

System.string

You can pipe the value of the ServerInstance parameter as a string to this cmdlet.

Outputs

System.Data.DataRow

Returns the company information as a data row for each company.