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

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 - 

Error After Restore SQL Backup of NAV 2013 Database

Hi all, we are facing a conman issue during restoring a SQL Database backup restored for NAV 2013. While Trying to run object from Object Designer we get below listed error (even the service is configured properly) - --------------------------- Microsoft Dynamics NAV Development Environment --------------------------- There are no NAV Server instances available for this database. You must ensure that a NAV Server instance is running and is configured to use the database before you perform this activity. --------------------------- OK    ---------------------------

Future - What Next After NAV 2016. Code Name - Madeira...

Hi All, While Browsing web I came across some article which says about next release of Microsoft Dynamics NAV. Let's see the History of Code Names Given to Previous Version  - NAV 2013 - Code Name 'Sicily' NAV 2015 - Code Name 'CRETE' NAV 2016 - Code Name 'CORFU' And as we all know that all these are the Islands.