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    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.