Share via


Mount-NAVTenant

Mount-NAVTenant

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

Syntax

Parameter Set: __AllParameterSets
Mount-NAVTenant [-ServerInstance] <String> [-AlternateId] <System.Collections.ObjectModel.ReadOnlyCollection[string]> [-DatabaseName] <System.String> [-DatabaseServer] <System.String> [-DefaultCompany] <System.String> [-Id] <TenantId> [-AllowAppDatabaseWrite] [-DatabaseInstance <System.String> ] [-DefaultTimeZone <System.TimeZoneInfo> ] [-DoNotSaveConfiguration] [-Force] [-Mode <SyncMode> ] [-NasServicesEnabled] [-OverwriteTenantIdInDatabase] [-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 2013 R2 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.

Parameters

-ServerInstance<String>

Specifies the Microsoft Dynamics NAV Server instance that you want to mount the tenant against, such as DynamicsNAV71. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV71', or the short name, such as 'DynamicsNAV71'.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Id<TenantId>

Specifies the ID of the tenant that you want to mount against the Microsoft Dynamics NAV Server instance, such as default or Tenant1.

If the tenant database has not been mounted on a Microsoft Dynamics NAV Server instance before, then the value that you specify becomes the ID that is assigned to the tenant database. The ID cannot be used by another tenant database and must comply with the following rules:

- Contains only letters (Aa-Zz), numbers (0-9), or dashes (-). Note: The ID is not case sensitive.

- Does start or end with a dash (-).

- Less than 63 characters.

If the database is the first tenant database ever to be mounted on the Microsoft Dynamics NAV Server instance, then you must set the value to default or set the OverwriteTenantIdInDatabase parameter to True, and then specify an ID according to the previous rules.

If the tenant database has been mounted on a Microsoft Dynamics NAV Server instance before, then you must specify the tenant ID that is assigned to that database or specify another ID and set the OverwriteTenantIdInDatabase parameter to True.

Aliases

Id

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 (7-1)'.

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

-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

-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

-DoNotSaveConfiguration

Specifies if the configuration must not be saved when the cmdlet has completed the task. If the parameter is not set, the configuration settings are automatically saved.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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

-Mode<SyncMode>

Specifies how the database schema for the tenant database is synchronized with the database schema that the mounted application database defines. The default value is Sync. You can specify the parameter value by name or by integer as described in the following list:

ForceSync = 0

The database schema in the tenant database is updated with the application database schema even if data is lost. For example, if a table or a field has been deleted in the current application, the table or field is removed from the tenant database even if it contains data.

DisallowChanges = 1

If the database schema in the tenant database is different from the current application, the tenant cannot be mounted against the Microsoft Dynamics NAV Server instance.

Sync = 2

The database schema in the tenant database will be updated unless data is lost. For example, if a table or a field has been deleted in the current application, and it contains data in the tenant database, the tenant cannot be mounted against the Microsoft Dynamics NAV Server instance.

CheckOnly = 3

Microsoft Dynamics NAV Server tests if a change in the current application will result in data loss in the tenant database if the tenant is mounted with Mode set to ForceSync. For example, if a table or a field has been deleted in the current application. and it contains data in the tenant database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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

-NasServicesEnabled

Specifies if NAS Services must be started for the tenant. The default value is false.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DefaultTimeZone<System.TimeZoneInfo>

Specifies the default time zone that is used by NAS Services, OData web services, and SOAP web services for this tenant. You can specify a string or and ID. Supported string values are UTC and 'Server Time Zone', which is the time zone of the server. The ID is the ID of a Windows time zone, which is defined in the system registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

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

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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 like MyServer\MyInstance.

Aliases

none

Required?

false

Position?

named

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 DynamicsNAV71 -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 DynamicsNAV71 Test Test_Database

--------------------------EXAMPLE 3--------------------------

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 4--------------------------

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 5--------------------------

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 DynamicsNAV71 -Id 'Test' -DatabaseName 'Test_Database'-AlternateId @( "test.mydomain.com", "http://mydomain.sharepoint.com/sites/teamsite" )