You do not have access to Microsoft Dynamics NAV. Verify that you have been set up as a valid user in Microsoft Dynamics NAV.

Before you can access Microsoft Dynamics NAV you should be known as a user in the NAV database. (The only exception is when there a created no users at all then everyone will be granted access with SUPER permissions.) So when you haven’t been created (in NAV) as a user you will get the following warning when you try to access the database:

User Not Created

If you want to learn more about the NAV Security System please check MSDN ‘Security and Protection

It’s really easy to fix this ‘problem’ with Powershell. Global steps:

  • Start Powershell ISE
  • Import the NAV Administration Module
  • Run Cmdlet to Add yourself to the NAV database and grant yourself Permissions with another Cmdlet.
  • Start the Windows Client (NAV)

I would recommend to use Powershell ISE. There are a lot of articles out there on the internet telling all the advantages it has.

How to import the NAV Administration Module:

Import-Module "$env:ProgramFiles\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1

Please mind that the module can only be loaded from the NAV Service Tier (NST) server, because the module is part of the NAV Administration Tools. Next, add the Windows Account you are using to start NAV with New-NAVServerUser:

New-NAVServerUser -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose

Adding yourself as a user isn’t enough. You also need to specify  which permission you have in NAV (authorization). If you are created as a user and try to start NAV you will now get the following warning:

No Permissions

This means you have no or not enough permissions although NAV knows who you are (authenticated) but that doesn’t mean you have the permission to read/start/do anything. So, in this example we will give the Windows account SUPER permissions (the highest privilege) in NAV. You can do this in Powershell with the New-NAVServerUserPermissionSet Cmdlet:

New-NAVServerUserPermissionSet -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose

Please replace $WindowsAccount with the User you want to give access and replace $Serverinstance with the proper NAV Instance. Below an example script where you only have to replace the ServerInstance variable. The script is automatically retrieving your current domain name and username. Let PowerShell work for you as much as possible… :)

$WindowsAccount = "$env:userdomain\$env:USERNAME"
$ServerInstance = "DynamicsNAV90"
Import-Module "$env:ProgramFiles\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1"
New-NAVServerUser -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose
New-NAVServerUserPermissionSet -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -PermissionSetId 'SUPER' -Verbose

 

 

Advertisements

Author: Ibrahiem Rasoelbaks

I'm a Technical Consultant working at 4PS.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s