Windows PowerShell Cmdlets for Business Central Version 18 (2021 Release Wave 1)

Business Central version 19 includes Windows PowerShell cmdlets for the installation and configuration of components that comprise a Business Central deployment, including the Business Central Server, Web Server, databases, and extensions. The cmdlets are available in three different modules that you access from the Business Central Administration Shell. Plus, there's a fourth module for development that you access from the Business Central Development Shell. For information about the cmdlets in each module, including the syntax, options, and examples, see the following sections.

Description See module
Administration Cmdlets for Business Central Microsoft.Dynamics.Nav.Management
Administration Cmdlets for Business Central Extensions Microsoft.Dynamics.Nav.Apps.Management
Administration Cmdlets for Business Central Web Server Instances NAVWebClientManagement
Development Cmdlets for Business Central Microsoft.Dynamics.Nav.Apps.Tools

For a list of new and changed cmdlets since Business Central version 17 (2019 release wave 2), see Cmdlet Changes in Business Central.

Important

Cmdlets can perform actions that can also be done from the client, such as creating and modifying entities like web services, companies, users, and more. Be aware that cmdlets do not execute code on application objects (such as tables or pages) that are associated with these entities. If you have added logic to these application objects, the logic will be ignored by the cmdlets. For example, if you added logic on table 9900 Web Service Aggregate to control the creation of web services, although this logic will run from the client, it will be ignored when creating web services by using the New-NAVWebService cmdlet.

Installing the modules

The modules are installed as part of the Business Central Server installation. When the Business Central Server is installed two shortcuts are added to the Windows Start menu:

  • Business Central Administration Shell shortcut runs the navadmintool.ps1.

  • Business Central Development Shell shortcut runs the navmodeltools.ps1.

For information about installing the Business Central Server, see Installing Business Central

Starting Business Central Administration Shell

There are two ways to start the Business Central Administration Shell on the computer that's running Business Central Server: from the Windows Start menu or from Windows PowerShell.

Important

To run the cmdlets in the Business Central Administration Shell, you must be a member of the local Administrator group on the computer where the shell is installed.

From the Start menu

The Start menu is the easiest way, especially if you only have one version Business Central installed. Go to Start, type Business Central Administration Shell in the search box, right-click the link that's found, and then choose Run as Administrator.

From Windows PowerShell

This way is useful when you have more than one Business Central version installed, and you don't have specific shortcuts to the Business Central Administration Shell for each version.

  1. Start Windows PowerShell as an administrator as follows:

    Select the Start, type PowerShell in the search box, right-click Windows PowerShell, then select Run as administrator.

    For more information, see Starting Windows PowerShell.

  2. At the command prompt, run the following command:

    Import-Module -name <path to navadmintool.ps1>
    

    Each Business Central Server installation includes a navadmintool.ps1 file for the Business Central Administration Shell. By default, file is located in the "C:\Program Files\Microsoft Dynamics 365 Business Central\<version number>\Service\navadmintool.ps1". Replace <path to navadmintool.ps1> with the path for version of the shell that you want to run, for example:

    Import-Module -name "C:\Program Files\Microsoft Dynamics 365 Business Central\190\Service\navadmintool.ps1" 
    

Starting a Business Central Development Shell

Like the Business Central Development Shell, there are two ways to start the Business Central Development Shell: from the Windows Start menu or from Windows PowerShell.

From the Start menu

The Start menu is the easiest way, especially if you only have one version Business Central installed. Go to Start, type Business Central Development Shell in the search box, the select the related link.

From Windows PowerShell

  1. Start Windows PowerShell as an administrator:

    Select the Start, type PowerShell in the search box, right-click Windows PowerShell, then select Run as administrator.

    For more information, see Starting Windows PowerShell.

  2. At the command prompt, enter the following command:

    Import-Module -name <path to navamodeltools.ps1>
    

    Each Business Central Server installation includes a navmodeltools.ps1 file for the administration shell. By default, file is located in the "C:\Program Files\Microsoft Dynamics 365 Business Central\<version number>\Service\navmodeltools.ps1". Replace <path to navmodeltools.ps1> with the path for version of the shell that you want to run, for example:

    Import-Module -name "C:\Program Files\Microsoft Dynamics 365 Business Central\190\Service\navmodeltools.ps1" 
    

See Also

Developer and IT-Pro Help for Business Central