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>]
Get-NAVCompany
[-IncludePartiallyDeleted]
-FilePath <String>
[-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.
Type: | String |
Aliases: | FileName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Force
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | SwitchParameter |
Position: | 2 |
Default value: | False |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | 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.
Type: | TenantId |
Aliases: | Id |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
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.