Skip to main content

NAV 2013 R2 - Introduction to PowerShell.

Hi All,

With Release of NAV 2013 Microsoft have introduced one more component of NAV Administrators.

Yes that is Microsoft Dynamics NAV 2013 R2 Administration Shell.

With Release of NAV 2013 R2 one more pr-requisite before installing Navision is Powershell which comes up with a windows Update.

Powershell can used to access all Cmdlets available for windows. we can also use same for running Cmdlets for NAV 2013.



What is Cmdlets?

A cmdlet is a lightweight command that is used in the Windows PowerShell environment. The Windows PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line. The Windows PowerShell runtime also invokes them programmatically through Windows PowerShell APIs.

What is Microsoft Dynamics NAV Windows PowerShell Cmdlets?

Windows PowerShell cmdlets for Server Administration are available with Microsoft Dynamics NAV 2013 R2. The cmdlets are implemented in Windows PowerShell 3.0. Windows PowerShell 3.0 is included with Windows Server 2012 and Windows 8. For other versions of Windows supported for Microsoft Dynamics NAV 2013 R2, you can install it as part of the Windows Management Framework 3.0 on the Microsoft Download Center.

To start a Windows PowerShell session that includes the Server Administration cmdlets, on the Start menu, choose All Programs, and then choose Microsoft Dynamics NAV 2013 R2 Administration Shell. This opens a Windows PowerShell prompt.

To see the cmdlets that are available for administering Microsoft Dynamics NAV, type the following at the Windows PowerShell prompt.

Get-Command *NAVServer*


For details of Cmdlets for Navision use the link.

How to Use PowerShell?

In Start Menu search for Windows PowerShell ISE and Run it as administrtor.



Now for using NAV Commands you need to import the modules in Powershell, that can be done by execution below command.
-------------------------------------------------------------------------------------
#Prepare PowerShell
Import-Module 'C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1'
-------------------------------------------------------------------------------------

Where C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1 is the default path of Navision cmdlets.

Once imported, it will behave similar to Microsoft Dynamics Administration tool.



We will be using PowerShell in future post, so i would suggest pin the Powershell ISE Shortcut to the TaskBar.

you can download Cmdlets from my SkyDriveFile Name - Command 1 - Import NAV Module.ps1

Regards,
Saurav Dhyani
saurav-nav.blogspot.in

Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing -