New-NAVTenant

DO NOT USE: This cmdlet is for internal use only. It can't be used for Business Central on-premises tenants. For information about managing on-premises tenants, see https://go.microsoft.com/fwlink/?linkid=2153727.

Syntax

New-NAVTenant
   [-ServerInstance] <String>
   [-Tenant] <TenantId>
   [-TenantDatabaseId] <TenantDatabaseId>
   [-TimeoutSeconds <Int32>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use the New-NAVTenant cmdlet to create a normal tenant (as opposed to a buffer tenant) in a specific tenant database. The tenant cannot have the same ID as any existing tenants in the tenant database.

The tenant database must be mounted on a Business Central Server instance that is configured as a multitenant server instance.

The new tenant will be empty, and will not be mounted on the Business Central Server instance. If you have a tenant in the tenant database that contains business data, you can use the Copy-NAVTenant to populate the new tenant with the same data.

The concept of creating new tenants and copying data can be useful in a deployment environment where you have to get new tenants up and running quickly on demand. This can be achieved by using buffer tenants. A buffer tenant is specific type of tenant in the tenant database that is typically pre-populated with data, but cannot be mounted in its current state. Buffer tenants are created using the Set-NAVTenant cmdlet, which changes a normal tenant to a buffer tenant. For more information about this scenario, see the help for the Set-NAVTenant cmdlet.

Examples

EXAMPLE 1

New-NAVTenant -ServerInstance NavServer -Tenant TenantB -TenantDatabaseId MyTenantDatabase

This example creates a new empty tenant with the name 'TenantB' in the tenant database 'MyTenantDatabase'. The tenant database is mounted on the Business Central Server instance 'NavServer'.

EXAMPLE 2

New-NAVTenant -ServerInstance NavServer -Tenant TenantB -TenantDatabaseId MyTenantDatabase
Mount-NAVTenant -ServerInstance NavServer -Tenant TenantB -TenantDatabaseId MyTenantDatabase
Copy-NAVTenantData -ServerInstance NavServer -SourceTenant TenantA -DestinationTenant TenantB

This example illustrate how you can use the New-NAVTenant cmdlet together with the Copy-NAVTenantData cmdlet to create a new tenant that is populated with data from another tenant. This example assumes that you already have a tenant named 'TenantA', which contains the business data that you want in the new tenant 'TenantB'. 'TenantA' must be mounted on the Business Central Server instance 'NavServer'.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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:False
Required:False
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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Tenant

Specifies the ID of the tenant that you want to create, such as TenantB. This must be unique in the tenant database.

Type:TenantId
Aliases:Id
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TenantDatabaseId

Specifies the ID of the tenant database in which you want to create the new tenant.

Type:TenantDatabaseId
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TimeoutSeconds

Specifies the minimum amount of seconds to keep trying in case of transient errors, such as when the database is temporarily offline. It defaults to the default Business Central internal timeouts for different error types.

Type:Int32
Position:Named
Default value:0
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

System.String

By value and by property name: ServerInstance

Microsoft.Dynamics.Nav.Types.TenantId

By property name: Tenant

Microsoft.Dynamics.Nav.Types.TenantDatabaseId

By property name: TenantDatabaseId