Import-NAVEncryptionKey

Import-NAVEncryptionKey

Imports an encryption key from a file to a Microsoft Dynamics NAV Server instance and database in SQL Server.

Syntax

Parameter Set: __AllParameterSets
Import-NAVEncryptionKey [[-ServerInstance] <String> ] [-KeyPath] <String> -ApplicationDatabaseName <String> -ApplicationDatabaseServer <String> [-ApplicationDatabaseCredentials <PSCredential> ] [-Force] [-Password <SecureString> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

When using SQL Server authentication between the Microsoft Dynamics NAV Server instance and database in SQL Server,Microsoft Dynamics NAV encrypts passwords that are used by a Microsoft Dynamics NAV Server instance to access to Microsoft Dynamics NAV databases in SQL Server. This includes, for example, the Microsoft Dynamics NAV Server service account credentials and the database credentials. To encrypt and decrypt the passwords, an encryption key is used. Microsoft Dynamics NAV uses a single encryption key per server instance. The encryption key must be installed on the computer where Microsoft Dynamics NAV Server is installed and in the Microsoft Dynamics NAV database.

In some cases, such as when upgrading or migrating a system from one set of hardware to another, you might need a copy of the encryption key that is used on one Microsoft Dynamics NAV Server instance to use on another Microsoft Dynamics NAV Server instance. By first using the Export-NAVEncryptionKey cmdlet to export the encryption key from one Microsoft Dynamics NAV Server instance to a file, you can then use the Import-NAVEncryptionKey to import the encryption key from the file to another Microsoft Dynamics NAV Server instance.

The Import-NAVEncryptionKey cmdlet enables you to specify a destination file for the encryption key and also specify a password that is used to protect the file, if any.

You cannot import an encryption key on the Microsoft Dynamics NAV Server instance if an encryption key file already exists. You must first delete the encryption key from the computer where Microsoft Dynamics NAV Server is installed. By default, encryption keys are stored in the C:\ProgramData\Microsoft\Microsoft Dynamics NAV\80\Server\Keys folder.

Parameters

-ApplicationDatabaseCredentials<PSCredential>

Specifies the user name and password of the login account to use to access the application database in SQL Server by using SQL Server authentication

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ApplicationDatabaseName<String>

Specifies the name of the Microsoft Dynamics NAV database in SQL Server to which you want to import the encryption key. In a multitenant deployment, this is the application database, which contains a list of mounted tenants.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ApplicationDatabaseServer<String>

Specifies the SQL Server name and instance, such as MyServer\MyInstance, that hosts the Microsoft Dynamics NAV database in which you want to import the encryption key. In a multitenant deployment, this is the application database, which contains a list of mounted tenants.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

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

-KeyPath<String>

The full path to the file that contains the encryption key. The full path includes the drive, folders and file name.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Password<SecureString>

Specifies a password that protects the encryption key file that are importing.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerInstance<String>

Specifies the Microsoft Dynamics NAV Server instance to which you want to import the encryption key, 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?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, 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 and KeyPath as strings 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

-----------

The following example imports an encryption key from a password protected file that has the file path C:\Keys\nav.key to the Microsoft Dynamics NAV Server instance that is called DynamicsNAV90. The encryption key is imported to the MyNavDB database on the MyNavSQLServer\MyNAV server instance in SQL Server.

PS C:\> Import-NAVEncryptionKey -ServerInstance DynamicsNAV90 -KeyPath "C:\Keys\nav.key" - ApplicationDatabaseServer MyNavSQLServer\MyNAV -ApplicationDatabaseName MyNavDB -Password (Get-Credential).Password