Skip to main content

Add User to Microsoft Dynamics NAV 2016 Database.

Hi All,

As New Version Release there are some changes in System Tables and the way how we resolve our issues that we found solution in Previous Versions.

With Release of Microsoft Dynamics NAV 2016, our famous issue Get Access to Database Need to be resolved.

If You Don't know the issue, here is a simple details -

You Receive a Database From Customer or you have a database on your server but you are not part of the Users in the database. When you try to access the Client (Windows / Web / Tablet / Phone) System generates Below Error Message.

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




IN Nav 2013, if you remember we discussed Two Ways to get access to the database - 

 > Delete All Users  (Can be Used with NAV 2016)

 > Add Your User From SQL (Will not work with NAV 2016)

But with Release of NAV 2013 R2 and Later, the Great Power Came with Powershell.
In This article we will see how we can use powershell cmdlet to Add Our User with Certain Permission in the database.

** Article Applies to NAV 2013 R2 and Later.

How to Open PowerShell, refer Here !!
--------------------------------------------------------------------------------------------------------------------------
1. Open Powershell as Administrator.

2. Import Navision Cmdlet, if you are using the ISE (I love to use this).

  •    import-module "C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1"

   ** Change 90 TO 80 or 71 for NAV 2015 or NAV 2013 R2 respectively.


3. Refresh the commands Panel and search for NAVServerUser, The result will be something like Shown Below..



4. Let's discuss in Brief about Search Results first -

Get-NavServerUser - Returns information about all users created in the current Microsoft Dynamics NAV database.
Get-NAVServerUserPermissionSet - Returns permission set information for Microsoft Dynamics NAV users.

New-NAVServerUser - Creates a new Microsoft Dynamics NAV user.
New-NAVServerUserPermissionSet - Assigns a permission set to a Microsoft Dynamics NAV user.

Remove-NAVServerUser - Deletes a Microsoft Dynamics NAV user.
Remove-NAVServerUserPermissionSet - Removes a permission set from the list of permission sets that are assigned to a Microsoft Dynamics NAV user.

 Set-NAVServerUser - Changes the configuration settings of an existing Microsoft Dynamics NAV user.

5. For the Purpose of this Article, we need to use only New-NavServerUser and New-NAVServerUserPermissionSet.
For others you can just select and specify the mandatory parameter to see how it works.

6. Select New-NAVServerUser and Specify the Required Parameter as shown below -



7. Now User is created, we need to assign Permission to user, select New-Select NAVServerUserPermissionSet and specify the required Parameter as shown Below -



All Done and we should be able to login to database now...

In This Article we used two cmdlet as below -

#Add User - 
New-NAVServerUser -ServerInstance <<Service Name>> -WindowsAccount <<Domain\USerName>> -LicenseType Full -State Enabled

#Add User Permission - 
New-NAVServerUserPermissionSet -PermissionSetId SUPER -ServerInstance <<Service Name>> -WindowsAccount "Domain\USerName"


Hope you find the information useful. Let me know your feedback as comment to article.

Regards,
Saurav Dhyani

Comments

  1. Mega Tip!
    Thank you very much Saurav.
    Best Regards,

    ReplyDelete

Post a Comment

Popular posts from this blog

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 - 

MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.