Import-NAVServerLicense
Imports a license file into a Business Central database.
Syntax
Import-NAVServerLicense
[-Tenant <TenantId>]
[-LicenseFile] <String>
[-Database <LicenseDatabase>]
[-ServerInstance] <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Import-NAVServerLicense
[-LicenseData] <Byte[]>
[-Tenant <TenantId>]
[-Database <LicenseDatabase>]
[-ServerInstance] <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Use the Import-NAVServerLicense cmdlet to import a license file into a Business Central database.
If the Business Central Server account specified does not have access to the location where the license file is stored, an error results. Check the Event Log on the Business Central Server computer to see what permissions are required.
After importing a new license, restart all Business Central Server instances to activate the license for client users.
Note
Depending on when you got the license, it will be available as either .flf file only or both a .flf and .bclicense file. We recommend that you use the .bclicense file if available. For more information, see Uploading the License File for Business Central On-Premises.
Examples
EXAMPLE 1
Import-NAVServerLicense BC -LicenseData ([Byte[]]$(Get-Content -Path "fin.bclicense" -Encoding Byte))
This example imports a license file that is named "fin.bclicense" from the current directory into the default database.
EXAMPLE 2
Import-NAVServerLicense MyInstance -LicenseData ([Byte[]]$(Get-Content -Path "fin.bclicense" -Encoding Byte)) -Database NavDatabase
This example imports a license file that is named "fin.bclicense" from the current directory into the local Business Central database that is used by the MyInstance Business Central Server instance.
EXAMPLE 3
Import-NAVServerLicense 'MicrosoftDynamicsNavServer$MyInstance' -LicenseData ([Byte[]]$(Get-Content -Path "fin.bclicense" -Encoding Byte)) -Database Master
This example imports a license file that is named "fin.bclicense" from the current directory into the master database.
EXAMPLE 4
Import-NAVServerLicense 'MicrosoftDynamicsNavServer$MyInstance' -LicenseData ([Byte[]]$(Get-Content -Path "fin.bclicense" -Encoding Byte)) -Database Tenant -Tenant Tenant1
This example imports a license file that is named "fin.bclicense" from the current directory into the database that is used by the specified tenant, Tenant1.
Parameters
-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 |
-Database
Specifies the database into which to import the license file. The possible values are described in the following list:
Default = 0
Default; overrides the license file currently in use.
Master = 1
Forces the license file to be global.
NavDatabase = 2
Forces the license file to be local and stored in the Business Central database that is used by the specified Business Central Server instance.
Tenant = 3
Forces the license file to be local and stored in the Business Central database that is used by the tenant that is specified in the Tenant parameter.
Type: | LicenseDatabase |
Accepted values: | Default, Master, NavDatabase, Tenant |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
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 |
-LicenseData
Specifies the content retrieved from the certificate file by using the Get-Content cmdlet. For more information, see the examples.
Type: | Byte[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LicenseFile
The LicenseFile parameter specifies the path to the Business Central license file.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
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 |
-Tenant
Specifies the ID of the tenant in which you want to import the license, such as Tenant1. This parameter is required unless the specified service instance is not configured to run multiple tenants.
Type: | TenantId |
Aliases: | Id |
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 a string that contains a Business Central Server instance name to the cmdlet.