web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

PowerShell - NAV commands

(0) ShareShare
ReportReport
Posted on by 511

Hi all,

First attempt to use PowerShell. Trying to type "New-NAVServerInstance", can't find it. Do I need to add any add-ons or install anything?

powershell.png

Microsoft Dynamics NAV 2017

Trying to do something similar like Waldo did in one of his "How Do I videos".

powershell-waldo.png

Thanks,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at
    RE: PowerShell - NAV commands

    Hi,

    - First, Make sure you run powershell as administration.

    - Run Following commands:

    Import-Module "C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1"

    Import-Module "C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\NavModelTools.ps1"

    These commands are for NAV 2017 but if you are on 2016 change them accordingly like change 100 to 90

    Thanks

  • Suggested answer
    Christos Christou Profile Picture
    511 on at
    RE: PowerShell - NAV commands

    Great. It worked. Thanks Zaid!

  • Christos Christou Profile Picture
    511 on at
    RE: PowerShell - NAV commands

    Now I am in the process of installing Web Server components but I am getting an error. See image below

    web-server-components-NAV-2017.png

    P.S I installed IIS features based on this article https://msdn.microsoft.com/en-us/library/hh167503(v=nav.90).aspx#Win8

    I also made sure ports 7045, 7046, 7047, 7048 are not used in my instances. 

    What's wrong with it?

    Thanks,

  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at
    RE: PowerShell - NAV commands

    Well, It seems like you missed something.

    Can you please verify the following:

    - .Net framework 3.5/4.5

    - IIS (rewrite component) installed successfully,

    - HTTP Activation is selected.

    If so try pc restart and then reinstall NAV components.

    Let me know in either case. Thanks

  • Suggested answer
    Roberto Stefanetti Profile Picture
    12,998 on at
    RE: PowerShell - NAV commands

    hi

    take a look here

    community.dynamics.com/.../195134

    community.dynamics.com/.../205229

    and here

    social.technet.microsoft.com/.../problem-installing-dynamics-nav-2016

  • Verified answer
    Christos Christou Profile Picture
    511 on at
    RE: PowerShell - NAV commands

    Thanks Roberto. I think the problem is that i am on Windows 10 HOME - I wont be able to install web server components. I would need Windows 10 PRO Edition for that. Let me do that and update you. :)

  • Verified answer
    Christos Christou Profile Picture
    511 on at
    RE: PowerShell - NAV commands

    Thanks Zaid. I think the problem is that i am on Windows 10 HOME - I wont be able to install web server components. I would need Windows 10 PRO Edition for that. Let me do that and update you. :)

  • Verified answer
    Christos Christou Profile Picture
    511 on at
    RE: PowerShell - NAV commands

    I upgraded my windows home to windows pro edition and web components have been installed successfully.

  • Zaid Tariq Profile Picture
    2,274 on at
    RE: PowerShell - NAV commands

    Great, glad to hear.

  • Community Member Profile Picture
    on at
    RE: PowerShell - NAV commands

    Running these scripts didn't help me.

    Import-Module "C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1"

    Import-Module "C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\NavModelTools.ps1"

    We currently have both NAV2009 and NAV2017.

    NAV2009 is on Prem but being replaced by NAV2017 in hosted remotely be a 3rd party company.

    The server has the NAVAdminTool.ps1 but not the NAVModelTools.ps1 located at \\RemoteServer\c$\Program Files\Microsoft Dynamics NAV\100\Service\NAVAdminTool.ps1

    Locally, NAV2017 is installed at C:\NAV201764BIT\RoleTailored Client\ .

    There are no *.ps1 in this whole directory on the C Drive, how do I get the registry to look at the powershell scripts?

     

    How can I import it from a remote server?

    Can I copy the NavAdminTool.ps1 file and paste it on My C Drive and import the module there?

    I did try this but received the following error message:

    "

    Welcome to the Server Admin Tool Shell!
    For a complete list of Server cmdlets type

    Get-Command -Module Microsoft.Dynamics.Nav.Management, Microsoft.Dynamics.Nav.Apps.Management

    Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Microsoft Dynamics NAV\100\Service' because it does not exist.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:17 char:32

    + ...  $snapInAssembly = Join-Path (Get-ItemProperty -path $nstPath).Path " ...

    +                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo          : ObjectNotFound: (HKLM:\SOFTWARE\...NAV\100\Service:String) [Get-ItemProperty], ItemNotFoundException

       + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

    Join-Path : Cannot bind argument to parameter 'Path' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:17 char:31

    + ... InAssembly = Join-Path (Get-ItemProperty -path $nstPath).Path "\$snap ...

    +                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

    Test-Path : Cannot bind argument to parameter 'Path' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:18 char:18

    +   if(!(Test-Path $snapInAssembly)) { $snapInAssembly = Join-Path (Get ...

    +                  ~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

    Import-Module : Cannot bind argument to parameter 'Name' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:21 char:17

    +   Import-Module $snapInAssembly -ErrorVariable errorVariable -ErrorAc ...

    +                 ~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Import-Module], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ImportModuleCommand

    Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Microsoft Dynamics NAV\100\Service' because it does not exist.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:17 char:32

    + ...  $snapInAssembly = Join-Path (Get-ItemProperty -path $nstPath).Path " ...

    +                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo          : ObjectNotFound: (HKLM:\SOFTWARE\...NAV\100\Service:String) [Get-ItemProperty], ItemNotFoundException

       + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

    Join-Path : Cannot bind argument to parameter 'Path' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:17 char:31

    + ... InAssembly = Join-Path (Get-ItemProperty -path $nstPath).Path "\$snap ...

    +                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

    Test-Path : Cannot bind argument to parameter 'Path' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:18 char:18

    +   if(!(Test-Path $snapInAssembly)) { $snapInAssembly = Join-Path (Get ...

    +                  ~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

    Import-Module : Cannot bind argument to parameter 'Name' because it is null.

    At C:\Program Files (x86)\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1:21 char:17

    +   Import-Module $snapInAssembly -ErrorVariable errorVariable -ErrorAc ...

    +                 ~~~~~~~~~~~~~~~

       + CategoryInfo          : InvalidData: (:) [Import-Module], ParameterBindingValidationException

       + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ImportModuleCommand

    "

    Thanks in advance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans