Search This Blog

How to create NAV Instances with multiple builds in the same machine for the same Navision Version (Through PowerShell)

The concepts described in this post are applicable to different versions/builds, for examples I will use an installation of Microsoft Dynamics Navision 2016 (9.00.50458) AU version and I will create one more instances also for the Microsoft Dynamics Navision 2016 (9.00.48466) IN version on the same machine.

Prerequisites:
  • Microsoft Dynamics Navision 2016 (9.00.50458) AU version should be installed on the machine as the base version.
  • Microsoft Dynamics Navision 2016 (9.00.48466) IN version setup downloaded from Microsoft Partner Source website.

Solution :

After you installed Navision 2016 (9.00.50458) AU version it`s Service files will be inside the following path:

C:\Program Files\Microsoft Dynamics NAV\90\  (As shown below)




Step - 1 : Copy the folder 90 in a new folder 90 – 48466 (As shown below)




Step - 2 : Copy all files from the Service folder, Which you will find in the Microsoft Dynamics Navision 2016 (9.00.48466) IN version setup folder (As shown below)

NAV.9.0.48466.IN CU 19.DVD\ServiceTier\program files\Microsoft Dynamics NAV\90\Service



Step -3 : Replace All the copied files into the Service folder on the given below path : (As shown below)

C:\Program Files\Microsoft Dynamics NAV\90 - 48466\Service

Note : Do not replace the files inside the base folder which was installed with setup.




Step – 4 : Open Windows PowerShell ISE (Run as Administrator) (As shown below)



Step - 5 : Run PowerShell command : (As shown below)

Set-ExecutionPolicy RemoteSigned

We will be running the script and by default, PowerShell stops running scripts. Run above command to set Execution Policy to Remote Signed.

Click on - Yes to ALL 



Step - 6 : Execute the following PowerShell CmdLet : (As shown below)

New-Service 'MicrosoftDynamicsNAVServer$Demo48466' -BinaryPathName '"C:\Program Files\Microsoft Dynamics NAV\90 - 48466\Service\Microsoft.Dynamics.Nav.Server.exe" $Demo48466 /config "C:\Program Files\Microsoft Dynamics NAV\90 - 48466\Service\Microsoft.Dynamics.NAV.Server.exe.config"' -DependsOn 'HTTP' -Description 'Service handling requests to Microsoft Dynamics NAV application.' -DisplayName 'Microsoft Dynamics NAV Server [Demo48466]' -StartupType Manual 

Note: you can replace Demo48466 with your preferred name 


As you can see in the given below image a new Service Instance has been created on Dynamics NAV 2016 Administration under the login account as SYSTEM.

Now all you have to do is just configure the Database Server, Database Instance & Database Name into Service Instance Configuration option.

Note : You may need to change the Ports of the  manually created Server Instance as it may conflict with other Service Instances already created on the machine.


*****In case of any error during the process, to delete/remove the created service use the following PowerShell CmdLet :

sc.exe delete 'MicrosoftDynamicsNAVServer$Demo48466' 

Note: don’t remove the instance using Microsoft Dynamics NAV 2016 Administration because, this is the Default instance for this build and it will removed the Service folder from the 90 - 48466 folder.


Hope you will find this post useful...
If any queries comment below..