Mount-NAVTenant

Mounts a tenant database against the specified Business Central Server instance.

Syntax

Mount-NAVTenant
     [-ServerInstance] <String>
     [-Tenant] <TenantId>
     [-DatabaseName] <String>
     [[-DatabaseServer] <String>]
     [[-DatabaseCredentials] <PSCredential>]
     [[-DatabaseInstance] <String>]
     [-AadTenantId <String>]
     [-ApplicationInsightsKey <String>]
     [-ApplicationInsightsConnectionString <String>]
     [-AlternateId <String[]>]
     [-ValidAudiences <String[]>]
     [-AzureKeyVaultSettings <AzureKeyVaultSettings>]
     [-DefaultCompany <String>]
     [-DefaultTimeZone <TimeZoneInfoConstructor>]
     [-DisplayName <String>]
     [-EncryptionProvider <EncryptionProvider>]
     [-EnvironmentType <NavTenantEnvironmentType>]
     [-ExchangeAuthenticationMetadataLocation <String>]
     [-EnvironmentName <String>]
     [-BindingManifest <String>]
     [-AllowAppDatabaseWrite]
     [-Async]
     [-NasServicesEnabled]
     [-OverwriteTenantIdInDatabase]
     [-RunNasWithAdminRights]
     [-SkipUpdateScheduledTaskList]
     [-EnvironmentSettings <Hashtable>]
     [-Force]
     [-ProgressAction <ActionPreference>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Mount-NAVTenant
     [-Tenant] <TenantId>
     [-DatabaseName] <String>
     [[-DatabaseServer] <String>]
     [[-DatabaseCredentials] <PSCredential>]
     [[-DatabaseInstance] <String>]
     [[-ApplicationDatabaseName] <String>]
     [[-ApplicationDatabaseServer] <String>]
     [[-ApplicationDatabaseCredentials] <PSCredential>]
     [-AadTenantId <String>]
     [-ApplicationInsightsKey <String>]
     [-ApplicationInsightsConnectionString <String>]
     [-AlternateId <String[]>]
     [-ValidAudiences <String[]>]
     [-AzureKeyVaultSettings <AzureKeyVaultSettings>]
     [-DefaultCompany <String>]
     [-DefaultTimeZone <TimeZoneInfoConstructor>]
     [-DisplayName <String>]
     [-EncryptionProvider <EncryptionProvider>]
     [-EnvironmentType <NavTenantEnvironmentType>]
     [-ExchangeAuthenticationMetadataLocation <String>]
     [-EnvironmentName <String>]
     [-BindingManifest <String>]
     [-AllowAppDatabaseWrite]
     [-Async]
     [-NasServicesEnabled]
     [-OverwriteTenantIdInDatabase]
     [-RunNasWithAdminRights]
     [-SkipUpdateScheduledTaskList]
     [-EnvironmentSettings <Hashtable>]
     [-Force]
     [-ProgressAction <ActionPreference>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Use the Mount-NavTenant cmdlet to mount a tenant database against the specified Business Central Server instance. The database must already exist, and it must be a valid Business Central database. Also, the Business Central Server instance must be configured for multitenancy. When a database is mounted against a Business Central Server instance, the server can process requests for data for it. When you mount a tenant database, the database is not synchronized against the application database. To synchronize the tenant database against the application database, you must use the Sync-NAVTenant cmdlet.

Examples

EXAMPLE 1

Mount-NAVTenant BC -Id 'Test' -DatabaseName 'Test_Database'

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Business Central Server instance.

EXAMPLE 2

Mount-NAVTenant BC Test Test_Database

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Business Central Server instance. The example uses positional arguments for the parameter values.

EXAMPLE 3

Mount-NAVTenant BC -Id 'Test' -DatabaseName 'Test_Database' -DatabaseCredentials (Get-Credential)

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Business Central Server instance. The example configures SQL authentication on the connection to the database with credentials that are obtained from the Get-Credential cmdlet.

EXAMPLE 4

Get-NAVTenant Server1 | Mount-NAVTenant Server2

This example gets information about the tenants that are mounted against the Server1 Business Central Server instance and mounts them against the Server2 instance. You must then dismount the tenants from the Server1 instance.

EXAMPLE 5

Get-NAVTenant Server1 | Dismount-NavTenant Server1 -Force | Mount-NAVTenant Server2

This example gets information about the tenants that are mounted against the Server1 Business Central Server instance, dismounts them, and then mounts them against the Server2 instance.

EXAMPLE 6

Mount-NAVTenant BC -Id 'Test' -DatabaseName 'Test_Database'-AlternateId @( "test.mydomain.com", "http://mydomain.sharepoint.com/sites/teamsite" )

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Business Central Server instance and adds a domain name and a SharePoint host URL to the alternative IDs.

EXAMPLE 7

Mount-NAVTenant -Id 'Test' -DatabaseName 'Test_Database' -DatabaseCredentials (Get-Credential) -ApplicationDatabaseServer 'MySQLServer\NAV' -ApplicationDatabaseName 'MyNavAppDatabase' -ApplicationDatabaseCredentials (Get-Credential) -KeyFilePath 'C:\key\nav.key' -KeyFilePassword (Get-Credential).Password

This example mounts a tenant, 'Test', which is based on the tenant database 'Test_Database', by specifying an application database instead of the Business Central Server instance. The application database server and instance is 'MySQLServer\NAV', and the application database is 'MyNavAppDatabase'. The example configures SQL Authentication for accessing both the tenant application databases. This example requires that you export the encryption key that is used by the Business Central Server instance to a file with the path and file name 'C:\key\nav.key'.

EXAMPLE 8

Mount-NAVTenant BC -Id 'Test' -DatabaseName 'Test_Database' -EnvironmentType Production -EnvironmentName 'Test'

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Business Central Server instance. It also sets parameters EnvironmentType and EnvironmentName that will identify the tenant in telemetry (in the custom dimensions environmentType and environmentName).

Parameters

-AadTenantId

Specifies the the GUID of the tenant in Microsoft Entra ID for the Business Central application. The tenant ID is used for authenticating Business Central users with Microsoft Entra ID.

The Microsoft Entra Tenant ID identities the directory for the Business Central application in Microsoft Entra ID. The tenant ID can be the tenant's domain name or GUID. You can get the domain name from the Domain settings for the AD tenant (directory) in the Azure Management Portal.

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

-AllowAppDatabaseWrite

Specifies if the tenant can write to the application database. The default value is false.

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

-AlternateId

Specifies the alternative IDs for the tenant, such as host names for the Business Central Web client, SOAP web services, OData web services, or the Business Central Windows client. If you use alternative IDs for tenant resolution in the Business Central Web client, you must also enable some of the UrlRewrite rules in the Web.Config file for the Business Central Web Server components.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationDatabaseCredentials

Specifies the user name and password of the login account that the Business Central Server instance will use to access the application database in SQL Server. This parameter configures the Business Central Server instance to use SQL Server Authentication instead of Windows Authentication on the connection to the application database. The login account must be a member of the db_owner role on the database. This parameter is only relevant when you set with the ApplicationDatabaseServer and ApplicationDatabaseName parameters

Type:PSCredential
Position:8
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationDatabaseName

Specifies the name of the application database to use with the tenant database. This parameter is only relevant if the Business Central Server instance is configured for multitenancy. This parameter, together with the ApplicationDatabaseServer parameter, enables you to mount a tenant to the same Business Central Server instance as the application database without having to connect a running Business Central Server instance.

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

-ApplicationDatabaseServer

Specifies the SQL Server name and instance, such as MyServer\MyInstance, that hosts the application database that you want to use with the tenant database,. This parameter, together with the ApplicationDatabaseName parameter, enables you to mount a tenant to the same Business Central Server instance as the application database without having to connect to a running Business Central Server instance.

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

-ApplicationInsightsConnectionString

Specifies the connection string of the Application Insights resource in Microsoft Azure that you want to use to monitor the tenant and gather telemetry.

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

-ApplicationInsightsKey

Specifies the instrumentation key of the Application Insights resource in Microsoft Azure that you want to use to monitor the tenant and gather telemetry.

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

-Async

Specifies to run the Mount-NAVTenant cmdlet asynchronously. The default value is false.

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

-AzureKeyVaultSettings

Specifies the Azure Key Vault settings to use for encrypting credentials that the Business Central Server instance uses to connect to the database.

The AzureKeyVaultSettings type contains the following attributes:

Client ID (or Application ID) - Specifies the GUID that is assigned to the key vault application in Microsoft Entra ID.

Client certificate store location - Specifies the certificate store location on the SQL Server computer for the Azure Key Vault certificate that will be used by the tenant. You can set the attribute to CurrentUser, which is your certificate store, or LocalMachine, which is the certificate store for the computer.

Client certificate store name - Specifies the name of the certificate store where the Key Vault certificate for the tenant is stored.

Client certificate thumbprint - Specifies the 40-character thumbprint of the tenant certificate. Do not include any spaces in the value.

Azure Key Vault URI - Specifies the URI that is assigned to the Azure Key Vault, such as https://navkeyvault123.vault.azure.net/keys/MyKey.

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

-BindingManifest

{{Fill BindingManifest Description}}

Type:String
Position:Named
Default value:None
Required:False
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

-DatabaseCredentials

Specifies the user name and password of the login account that the Business Central Server instance will use to access the tenant database in SQL Server. This parameter configures the Business Central Server instance to use SQL Server Authentication instead of Windows Authentication on the connection to the database. The login account must be a member of the db_owner role on the database.

Type:PSCredential
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DatabaseInstance

Specifies the name of the SQL Server instance that hosts the database. You can also specify the instance in the DatabaseServer parameter, such as MyServer\MyInstance.

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

-DatabaseName

Specifies the name of the Business Central database that you want to mount against the Business Central Server instance, such as 'Demo Database NAV (11-0)'.

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

-DatabaseServer

Specifies the name of the database server that hosts the Business Central database that you want to mount against the Business Central Server instance.

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

-DefaultCompany

Specifies the name of the company that NAS services, OData web services, and SOAP web services use if no other company is specified.

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

-DefaultTimeZone

Specifies the default time zone that is used by the NAS services, OData web services, and SOAP web services for this tenant. You can set the parameter to UTC, 'Server Time Zone', or the ID of a Windows Time Zone. UTC specifies that all business logic for services on the server instance runs in Coordinated Universal Time (UTC). 'Server Time Zone' specifies that services use the time zone of the computer that is running Business Central Server instance. ID of a Windows Time Zone specifies that services use a Windows time zone as defined in the system registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. For example, Romance Standard Time is a valid Windows time zone value. If this parameter is not specified, the value is taken from the ServicesDefaultTimeZone setting in the CustomSetting.config file for the Business Central Server instance.

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

-DisplayName

Specifies a user-friendly name of the tenant. This parameter is not relevant for on-premise installations.

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

-EncryptionProvider

Specifies the name of the encryption provider.

Type:EncryptionProvider
Accepted values:LocalKeyFile, AzureKeyVault
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EnvironmentName

Specifies the environment name of the tenant. This will be emitted as a dimension to telemetry.

Type:String
Aliases:UrlName
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EnvironmentSettings

Specifies the environment settings of the tenant.

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

-EnvironmentType

Specifies whether the tenant is used in a production or sandbox environment.

Possible values: Production, Sandbox

Type:NavTenantEnvironmentType
Accepted values:Production, Sandbox
Position:Named
Default value:Production
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ExchangeAuthenticationMetadataLocation

Specifies the URL for Microsoft Exchange authentication metadata document of the service or authority that is trusted to sign Exchange identity tokens. This URL is compared to the Exchange authentication metadata document URL in the Exchange identity token. The scheme and host part of the two URLs must match to pass authentication. Paths in the URLs require only partial match.

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

-NasServicesEnabled

Specifies to enable NAS services on the tenant. The default value is false.

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

-OverwriteTenantIdInDatabase

Specifies if the Mount-NAVTenant cmdlet must overwrite the tenant ID in the database if the database has been mounted as a tenant earlier. If this is false, and the tenant database has previously been mounted with a different tenant ID, an exception is thrown.

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

-ProgressAction

A common PowerShell parameter that determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider. Learn more.

Type:ActionPreference
Aliases:proga
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunNasWithAdminRights

Specifies the NAS services to run with administrator rights. This grants the NAS service the same permissions as the SUPER permission set in Business Central without having to add the Business Central Server service account as a user. The default is false.

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

-SkipUpdateScheduledTaskList

Specifies if the Mount-NAVTenant cmdlet Should update the list of scheduled tasks when mounted. If this is false the scheduled task list will not be updated. The list of scheduled tasks can be updated with the Update-NavScheduledTaskList cmdlet

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

-Tenant

Specifies the ID of the tenant that you want to mount on the Business Central Server instance, such as Tenant1.

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

-ValidAudiences

A semicolon-separated list of host names used by the tenant, like https://tenant1.cronusinternational.com. This setting is only required for the Business Central add-in for Outlook to validate access tokens. For more information, see Set Up the Business Central Add-In for Outlook with Business Central On-premises.

Type:String[]
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

Inputs

System.String

You can pipe the ServerInstance as a string to this cmdlet.

Outputs

None