PowerShell

Some OMA users register several NAV instances for the same NAV database. For example, one instance is used for RTC and the second one for NAS or web services. In this scenario, when OMA exports objects which contain dotNET references, NAV will pop up a dialog window with the list of available instances and will require to select one of them. In standard development environment it is possible to do this manually. But when OMA exports such object(s) on the server in background, the error will appear.

Several Instances Error
Several Instances Error


In this scenario, we recommend using the PowerShell option of Object Management Type. This option can be found either on the Object Manager Setup page or on the Database Card page.

If you are using the Database Card for setting up your database connection, you should change this option on the Database Card also. Otherwise, you can do it on the Object Manager Setup page.

Once you change this option from Finsql to PowerShell, OMA will try to update Microsoft.Dynamics.Nav.Server.exe.config file in the Service folder. In most cases this file is protected. Therefore, OMA is not able to update it automatically. You will be notified about that.

For using the PowerShell option, you will need to configure the NAV service tier and server. Please run PowerShell window as Administrator.

On the server where NAV Service is running, please set the execution policy by typing this into your PowerShell window:
Set-ExecutionPolicy RemoteSigned

Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy RemoteSigned


In some cases, it will be required to setup Windows Remote Management (WinRM) service. For this purpose you need to open Command Prompt (as Administartor) and run the following command:
winrm quickconfig

winrm quickconfig
winrm quickconfig


In the Service folder please open Microsoft.Dynamics.Nav.Server.exe.config file in Notepad or Notepad++ (recommended). The Default path of the Service folder for D365BC is C:\Program Files\Microsoft Dynamics 365 Business Central\130\Service. Find NetFx40_LegacySecurityPolicy option. By default the attribute enabled=”true”. It has to be changed to enabled=“false”.

NetFx40_LegacySecurityPolicy
NetFx40_LegacySecurityPolicy


Please close and save the file. After this change you will need to restart your NAV service instance(s).