Mount-NAVTenant
Mount-NAVTenant
Mounts a tenant database against the specified Microsoft Dynamics NAV Server instance.
Syntax
Parameter Set: __AllParameterSets
Mount-NAVTenant [-AlternateId] <System.Collections.ObjectModel.ReadOnlyCollection[string]> [-AzureKeyVaultSettings] <Microsoft.Dynamics.Nav.Types.AzureKeyVaultSettings> [-DatabaseInstance] <System.String> [-DatabaseName] <System.String> [-DatabaseServer] <System.String> [-DefaultCompany] <System.String> [-DefaultTimeZone] <System.TimeZoneInfo> [-NasServicesEnabled] [-RunNasWithAdminRights] [[-ApplicationDatabaseCredentials] <PSCredential> ] [[-ApplicationDatabaseName] <System.String> ] [[-ApplicationDatabaseServer] <System.String> ] [-AllowAppDatabaseWrite] [-DatabaseCredentials <PSCredential> ] [-EncryptionProvider <Microsoft.Dynamics.Nav.Types.EncryptionProvider> ] [-Force] [-OverwriteTenantIdInDatabase] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: UseDatabase
Mount-NAVTenant [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: UseNST
Mount-NAVTenant [-ServerInstance] <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed 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 2016 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.
Parameters
-AllowAppDatabaseWrite
Specifies if the tenant can write to the application database. The default value is false.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-AlternateId<System.Collections.ObjectModel.ReadOnlyCollection[string]>
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.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ApplicationDatabaseCredentials<PSCredential>
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
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ApplicationDatabaseName<System.String>
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.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ApplicationDatabaseServer<System.String>
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.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DatabaseCredentials<PSCredential>
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-AzureKeyVaultSettings<Microsoft.Dynamics.Nav.Types.AzureKeyVaultSettings>
Specifies the Azure key vault settings. This parameter is available only if the EncryptionProvider is set to AzureKeyVault.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DatabaseInstance<System.String>
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.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DatabaseName<System.String>
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 (8-0)'
.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DatabaseServer<System.String>
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.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DefaultCompany<System.String>
Specifies the name of the company that NAS services, OData web services, and SOAP web services use if no other company is specified.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DefaultTimeZone<System.TimeZoneInfo>
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.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-EncryptionProvider<Microsoft.Dynamics.Nav.Types.EncryptionProvider>
Specifies the name of the encryption provider.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-NasServicesEnabled
Specifies to enable NAS services on the tenant. The default value is false.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
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 Microsoft Dynamics NAV without having to add the Microsoft Dynamics NAV Server service account as a user. The default is false.
Aliases |
Id |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ServerInstance<String>
Specifies the Microsoft Dynamics NAV Server instance that you want to mount the tenant against, such as DynamicsNAV90. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV90', or the short name, such as 'DynamicsNAV90'.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
System.String
You can pipe the ServerInstance as a string to this cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
None
This cmdlet does not generate any output.
Examples
--------------------------EXAMPLE 1--------------------------
Description
-----------
This example mounts a tenant, 'Test', that is based on the tenant database 'Test_Database' on the specified Microsoft Dynamics NAV Server instance.
PS C:\> Mount-NAVTenant DynamicsNAV90 -Id 'Test' -DatabaseName 'Test_Database'
--------------------------EXAMPLE 2--------------------------
Description
-----------
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.
PS C:\> Mount-NAVTenant DynamicsNAV90 Test Test_Database
--------------------------EXAMPLE 3--------------------------
Description
-----------
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.
PS C:\> Mount-NAVTenant DynamicsNAV90 -Id 'Test' -DatabaseName 'Test_Database' -DatabaseCredentials (Get-Credential)
--------------------------EXAMPLE 4--------------------------
Description
-----------
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.
PS C:\> Get-NAVTenant Server1 | Mount-NAVTenant Server2
--------------------------EXAMPLE 5--------------------------
Description
-----------
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.
PS C:\> Get-NAVTenant Server1 | Dismount-NavTenant Server1 -Force | Mount-NAVTenant Server2
--------------------------EXAMPLE 6--------------------------
Description
-----------
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.
PS C:\> Mount-NAVTenant DynamicsNAV90 -Id 'Test' -DatabaseName 'Test_Database'-AlternateId @( "test.mydomain.com", "http://mydomain.sharepoint.com/sites/teamsite" )
--------------------------EXAMPLE 7--------------------------
Description
-----------
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'.
PS C:\> 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