Use the Remove-NAVCompany cmdlet to remove a company from the specified tenant database.
When you remove a company, the company and all of the data that it contains will be deleted.
We recommend that you make a backup before you remove a company.
You must also make sure that you are the only active user for the company before you remove the company.
Examples
EXAMPLE 1
Remove-NAVCompany -ServerInstance BC -Tenant CRONUS -CompanyName 'CRONUS International Ltd.'
This example removes the CRONUS International Ltd.
company from the database that has the tenant ID CRONUS and which is mounted against the BC server instance.
Parameters
-CompanyName
Specifies the name of the company that you want to delete.
If the company does not exist in the Business Central database, the operation fails.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
1
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-Confirm
Prompts you for confirmation before executing the command.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
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
-ForceImmediateDataDeletion
Specifies to delete all company data immediately.
This parameter only applies when the Business Central Server instance is configured to delete companies incrementally, which is done by setting the UseIncrementalCompanyDelete configuration key to 'true'. In this case, the company data is not deleted immediately but is done later by task scheduler. You use this parameter to override the UseIncrementalCompanyDelete configuration setting.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
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
(All)
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
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-WhatIf
Describes what would happen if you executed the command without actually executing the command.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
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.