Copy-NAVCompany

Creates a new company and copies all data from an existing company in the same tenant database.

Syntax

Copy-NAVCompany
    [-Tenant <TenantId>]
    [-DestinationCompanyName] <String>
    [-SourceCompanyName] <String>
    [-ServerInstance] <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use the Copy-NAVCompany cmdlet to create a new company based on an existing company in the same tenant database. The company that the Copy-NAVCompany cmdlet creates includes the data from the existing company. To create an empty company, use the New-NAVCompany cmdlet.

Examples

EXAMPLE 1

Copy-NAVCompany -ServerInstance BC -Tenant CRONUS -DestinationCompanyName 'Cronus Subsidiary' -SourceCompanyName 'Cronus International Ltd.'

This example creates a copy of the Cronus International Ltd. company in the database that has the tenant ID CRONUS and which is mounted against the BC server instance.

Parameters

-Confirm

Prompts you for confirmation before executing the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DestinationCompanyName

Specifies the name of the company that you want to create. If a company with that name already exists in the Business Central database, the cmdlet fails.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-SourceCompanyName

Specifies the name of the company that you want to copy.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False