Get-NAVCompany
Get-NAVCompany
Gets a list of the Microsoft Dynamics NAV companies in the specified tenant database.
Syntax
Parameter Set: FileSet
Get-NAVCompany -FilePath <String> [-Force] [ <CommonParameters>]
Parameter Set: NavServerSet
Get-NAVCompany [-ServerInstance] <String> [[-Tenant] <TenantId> ] [-Force] [ <CommonParameters>]
Detailed Description
Use the Get-NAVCompany cmdlet to extract a list of companies in the specified database. In the Microsoft Dynamics NAV 2016 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
Parameters
-FilePath<String>
Specifies the path and name of the exported file that you want to get the company information from.
Aliases |
FileName |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ServerInstance<String>
Specifies the Microsoft Dynamics NAV Server instance that the company uses, such as DynamicsNAV90. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV90', or the short name, such as 'DynamicsNAV90'.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
-Tenant<TenantId>
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.
Aliases |
Id |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
System.String
You can pipe the value of the ServerInstance parameter as a string to this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
System.Data.DataRow
Returns the company information as a data row for each company.
Examples
--------------------------EXAMPLE 1--------------------------
Description
-----------
This example shows a list of companies in the tenant database that has the tenant ID CRONUS and which is mounted against the DynamicsNAV90 server instance.
PS C:\> Get-NAVCompany -ServerInstance DynamicsNAV90 -Tenant CRONUS
--------------------------EXAMPLE 2--------------------------
Description
-----------
This example shows a list of companies that are contained in the my-exported.navdata file that is located in the c:\file folder.
PS C:\> Get-NAVCompany -FilePath c:\file\my-exported.navdata