Remove-NAVCompany

Removes a company from a Microsoft Dynamics NAV database.

Syntax

Remove-NAVCompany
      [-Tenant <TenantId>]
      [-CompanyName] <String>
      [-ForceImmediateDataDeletion]
      [-ServerInstance] <String>
      [-Force]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

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 DynamicsNAV -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 DynamicsNAV server instance.

Parameters

-CompanyName

Specifies the name of the company that you want to delete. If the company does not exist in the Microsoft Dynamics NAV database, the operation fails.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before executing the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

-ForceImmediateDataDeletion

Specifies to delete all company data immediately.

This parameter only applies when the Dynamics NAV 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.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ServerInstance

Specifies the name of a Dynamics NAV Server instance, for example, DynamicsNAV 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:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False