How to Create Server Instance in Business Central

Introduction

Business Central comes with a default Server Instance which can be configured to our requirements during the Business Central installation process. What if we need more server instances and with Business Central Administration Tool deprecated, we have to use the Command Line Interface.

The following Script Example Uses Business central 22 Version, but it works fine for other versions as well. Just remember to change the path of the modules based on the version you would like to create instances for.

Create New Instance

This is the standard script I use to create New Server instances.

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

Import-Module 'C:\Program Files\Microsoft Dynamics 365 Business Central\220\Service\NavAdminTool.ps1'

Import-Module -Name "C:\Program Files\Microsoft Dynamics 365 Business Central\220\Service\NAVWebClientManagement.psm1" 

New-NAVServerInstance -ManagementServicesPort 7000 -ClientServicesPort 7001 -SOAPServicesPort 7002 -ODataServicesPort 7003 -DeveloperServicesPort 7004 -SnapshotDebuggerServicesPort 7005 -DatabaseServer HOSTName -DatabaseInstance BCDEMO -DatabaseName "Demo Database BC (22-4) - IN" -ClientServicesCredentialType Windows -ServerInstance "BC224IN" -ServiceAccount NetworkService

New-NAVWebServerInstance -PublishFolder 'C:\Program Files\Microsoft Dynamics 365 Business Central\220\Web Client\WebPublish' -WebServerInstance BC224IN -Server localhost -ServerInstance BC224IN -ClientServicesCredentialType Windows -ClientServicesPort 7001 -ManagementServicesPort 7000 -SiteDeploymentType SubSite

Start-NavServerInstance -ServerInstance BC224IN
  1. Using the Set-ExecutionPolicy command, we give powershell freedom to make changes which is needed by Business central to host Web Services
  2. Using the Import-Module commands, the NavWebClientManagement.psm1 and the NavAdminTool.ps1 script files are imported.
  3. Using the New-NavServerInstance command and New-NavWebServerInstance command, a new server instance is created along with the Web Server Instance used for hosting the Web Application.
  4. The Port Number parameters must be unique and should not be used by any other Application including other installations of Business Central
  5. The Start-NavServerInstance command is used to start the Server Instance once the creation is complete.

Hope the read was worth your time. Thank you for Reading

How to Find Vendor No. with Vendor Name

Who this is for: AL developers building custom tables in Business Central who want users to search by vendor name instead of memorizing vendor codes. Most tables in Business Central use “Vendor No.” as a foreign key because it is the primary key of the Vendor table — stable, unique, and fast to look up.…

How to Create Excel File in Business Central

Introduction Let’s assume that we have a situation where I need to export Customer data from Business Central in an Excel Sheet. The simplest way would be to use the Export Functionality in Business Central But this would require Human interaction with the system. Let’s Automate this using the Excel Buffer Table in Business Central.…

How to Install LS Retail in Docker Container

Introduction Let’s first Create the docker Container using BCContainerHelper Module.If you would like to know how to install the moduleI got you covered.Check this Blog out https://sivagurumuralidharan.com/2023/10/20/how-to-install-bccontainerhelper/ Creating Docker Container with LS Setup Using the New-BcContainerWizard in Powershell, Get started with creating the container. I used to the Below Mentioned Code to create my container.…

Comments

Leave a comment