Mount-NAVTenant

Mounts a tenant database against the specified Microsoft Dynamics NAV Server instance.

Syntax

Mount-NAVTenant
     [-ServerInstance] <String>
     [-Tenant] <TenantId>
     [-DatabaseName] <String>
     [[-DatabaseServer] <String>]
     [[-DatabaseCredentials] <PSCredential>]
     [[-DatabaseInstance] <String>]
     [-AadTenantId <String>]
     [-AlternateId <String[]>]
     [-AzureKeyVaultSettings <AzureKeyVaultSettings>]
     [-DefaultCompany <String>]
     [-DefaultTimeZone <TimeZoneInfoConstructor>]
     [-DisplayName <String>]
     [-EncryptionProvider <EncryptionProvider>]
     [-EnvironmentType <NavTenantEnvironmentType>]
     [-ExchangeAuthenticationMetadataLocation <String>]
     [-UrlName <String>]
     [-AllowAppDatabaseWrite]
     [-Async]
     [-NasServicesEnabled]
     [-OverwriteTenantIdInDatabase]
     [-RunNasWithAdminRights]
     [-SkipUpdateScheduledTaskList]
     [-Force]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Mount-NAVTenant
     [-ServerInstance] <String>
     [-Tenant] <TenantId>
     -TenantDatabaseId <TenantDatabaseId>
     [-AadTenantId <String>]
     [-AlternateId <String[]>]
     [-AzureKeyVaultSettings <AzureKeyVaultSettings>]
     [-DefaultCompany <String>]
     [-DefaultTimeZone <TimeZoneInfoConstructor>]
     [-DisplayName <String>]
     [-EncryptionProvider <EncryptionProvider>]
     [-EnvironmentType <NavTenantEnvironmentType>]
     [-ExchangeAuthenticationMetadataLocation <String>]
     [-UrlName <String>]
     [-AllowAppDatabaseWrite]
     [-Async]
     [-NasServicesEnabled]
     [-OverwriteTenantIdInDatabase]
     [-RunNasWithAdminRights]
     [-SkipUpdateScheduledTaskList]
     [-Force]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Mount-NAVTenant
     [-Tenant] <TenantId>
     [-DatabaseName] <String>
     [[-DatabaseServer] <String>]
     [[-DatabaseCredentials] <PSCredential>]
     [[-DatabaseInstance] <String>]
     [[-ApplicationDatabaseName] <String>]
     [[-ApplicationDatabaseServer] <String>]
     [[-ApplicationDatabaseCredentials] <PSCredential>]
     [-AadTenantId <String>]
     [-AlternateId <String[]>]
     [-AzureKeyVaultSettings <AzureKeyVaultSettings>]
     [-DefaultCompany <String>]
     [-DefaultTimeZone <TimeZoneInfoConstructor>]
     [-DisplayName <String>]
     [-EncryptionProvider <EncryptionProvider>]
     [-EnvironmentType <NavTenantEnvironmentType>]
     [-ExchangeAuthenticationMetadataLocation <String>]
     [-UrlName <String>]
     [-AllowAppDatabaseWrite]
     [-Async]
     [-NasServicesEnabled]
     [-OverwriteTenantIdInDatabase]
     [-RunNasWithAdminRights]
     [-SkipUpdateScheduledTaskList]
     [-Force]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Use the Mount-NavTenant cmdlet to mount a tenant database against the specified Microsoft Dynamics NAV Server instance. The database must already exist, and it must be a valid Microsoft Dynamics NAV database. Also, the Microsoft Dynamics NAV Server instance must be configured for multitenancy. When a database is mounted against a Microsoft Dynamics NAV 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 DynamicsNAV -Id 'Test' -DatabaseName 'Test_Database'

This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Microsoft Dynamics NAV Server instance.

EXAMPLE 2

Mount-NAVTenant DynamicsNAV Test Test_Database

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

EXAMPLE 3

Mount-NAVTenant DynamicsNAV -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 Microsoft Dynamics NAV 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 Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Server instance, dismounts them, and then mounts them against the Server2 instance.

EXAMPLE 6

Mount-NAVTenant DynamicsNAV -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 Microsoft Dynamics NAV 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 Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Server instance to a file with the path and file name 'C:\key\nav.key'.

Parameters

-AadTenantId

Specifies the the GUID of the tenant in Azure Active Directory for the Dynamics NAV application. The tenant ID is used for authenticating Dynamics NAV users with Azure AD.

The Azure AD Tenant ID identities the directory for the Microsoft Dynamics NAV application in Azure AD. 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 Microsoft Dynamics NAV Web client, SOAP web services, OData web services, or the Microsoft Dynamics NAV Windows client. If you use alternative IDs for tenant resolution in the Microsoft Dynamics NAV Web client, you must also enable some of the UrlRewrite rules in the Web.Config file for the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Server instance will use to access the application database in SQL Server. This parameter configures the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Server instance is configured for multitenancy. This parameter, together with the ApplicationDatabaseServer parameter, enables you to mount a tenant to the same Microsoft Dynamics NAV Server instance as the application database without having to connect a running Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Server instance as the application database without having to connect to a running Microsoft Dynamics NAV Server instance.

Type:String
Position:7
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 Dynamics NAV 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 Azure AD.

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

-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 Microsoft Dynamics NAV Server instance will use to access the tenant database in SQL Server. This parameter configures the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV database that you want to mount against the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV database that you want to mount against the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV 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 Microsoft Dynamics NAV 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

-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

-RunNasWithAdminRights

Specifies the NAS services to run with administrator rights. This grants the NAS service the same permissions as the SUPER permission set in Microsoft Dynamics NAV without having to add the Microsoft Dynamics NAV 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 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

-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 Dynamics NAV Server instance, such as Tenant1.

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

-TenantDatabaseId

The shared schema feature is for use in conjunction only with Microsoft hosted offerings in Dynamics 365, is unsupported in Dynamics NAV, and may not be used outside Dynamics 365.

Specifies the ID of the tenant database that contains the tenant you want to mount. The tenant database must be mounted on the Dynamics NAV Server instance. You mount the tenant database by using the Mount-NAVTenantDatabase cmdlet.

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

-UrlName

Specifies the URL 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

-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