NAV Instance and Tenant Administration


This package contains the basic functionality to manage your Dynamics NAV installations.  The C/AL code is written for Dynamics NAV 2015 and it can manage installations from Dynamics NAV 2013 R2 and later. Included also is a PowerShell script package.  The package uses extended version of PowerShell for NAV that is available for download here.  This is intended to be the building block to start your own management tool both in your cloud environment and in your developement environment.


The code is programmed in a Tablet Client friendly way so this can be very user friendly.

Begin with the PSM Setup.  This is where you add the authentication used for PowerShell.  The username and password are stored encrypted in the database.  Encryption is done with the new build-in encryption functionality in Dynamics NAV 2015.  Remember to download the Encryption Key from the Encryption Management Page.


Open the Script list from the Role Center Ribbon and import one of the script packages included in the download.


All the scripts, script settings and the script parameters will be imported.  In the Script Setup a script is selected to for each function.  In here the management module path is also specified and that path is used when the client is started from Dynamics NAV.

The File Storage is also accessible from the Role Center Ribbon.  In the file storage table I store NAV Licenses, Database Backup, NAV Data and Zipped Mage.exe for ClickOnce.  To install a new file create a new line and upload a file.  Big files must be uploaded manually to the NAV Server and imported there.  Smaller files can be imported directly from the NAV Client.  The third option is to import a NAV Data File from one of the existing NAV databases.

FileStorageThe management is based on Deployment Groups.  Each instance must have a unique deployment group.  If two or more servers are running the same installation then the corresponding instances will have the same deployment group on all the servers.


The Accessibility section is for defining the access to the installation.  The Network Service or a Load balancer DNS name is defined; for the Windows Client, the Web Client and for the ClickOnce Web Site.  If using non-domain authentication then a DNS Identity for the SSL Certificate is needed.  The application name and the application publisher is required for the ClickOnce distribution.

The deployment servers are defined and the functions to create new database, new instance and new tenant is accessible from the deployment group.  The NAV DVD path is required for several scripts, for example the ones that handle the binary update for servers and clients.

The Import Server Instance button on the Role Center Ribbon will import all the computers in the Active Session table.  Computers can also be added manually.  I Suggest using full DNS computer names.  When the server has been created all the information about the server can be imported.  To simplify the file transfer a file share is created on the computers.  The file share must be fully accessible by the user running the NAV Management Server Instance and by the user running PowerShell.  When the file share path is added the service will try to create a temporary file and report the result.


After a succesful import all the server instances and intance tenants should be visible.  For a single tenant instance a default tentant is created.  From the Server Instance page it is easy to start a NAV Client and a NAV Debugger.


The State button on the Ribbon will open the Instance Control Page.  The running state of the service and all the configuration will be displayed.  Here it is possible to update the configuration and start or stop the service.  Changes in the configuration is highlighted until they are committed to the service configuration.


A new instance is created on the deployment group.  When creating an instance the system will suggest the next available ports based on the existing ports, beginning with port 7045.

During import all the known databases are imported.  A new database can be created from scratch, from a database backup file in the file storage table and from a database backup file on the client computer.  The database backup file on the client computer will be copied to the SQL server with a file copy command.

I created an empty database with the NAV Developement Client and made a Database Backup file based on that.  Every new database I need is created from that backup. When the database has been created it is possible to use NAV Data to import the needed data.


From here it is easy to start the NAV Developement.  Some upgrades require the database upgrade by the NAV Developement.  This can be triggered via PowerShell from the Ribbon.  Companies and Users can be imported for used database; that is, databases linked to a tenant.

For the day to day usage of this management tool we use the Tenant List.  Each user can create a list of favorite tenants and create a customized view of that list by filtering on the field “Favorite Tenant”.  From this list the clients can be started, license updated, users and companies created and modified.


A new tenant is created from the deployment group and mounted onto all the servers in the deployment. For a multitenancy environment that is not using the alternate id functionality I usually create a redirect path.  For example I make sure that will start the ClickOnce installation and the will start the Web Client while I still need to use for the Table Client.





Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.