If you ever find yourself locked out from the NAV database because one user has added themselves as a user in NAV but not added anybody else, there are few things that you can do to get access to NAV RTC.

Option 1:
Ask a user that already has access to NAV through RCT to add you as a user is well and assign appropriate permission sets. This is by far the easiest options as it involves the least amount of effort and information on how to do this is widely available online.

Option 2:
Delete all existing users from NAV database through SQL. “DELETE FROM [dbo].[User] GO” command will delete all existing NAV users from the specified database. This allows any user to connect to NAV database through RTC. The obvious downside to this is that the data from the Users table will be lost.

Option 3:
It is also possible to add NAV users through SQL. This is done by adding records to User, Access Control and User Property tables using the INSERT INTO command. This method is slightly more complicated than the two above as it requires some SQL knowledge and some knowledge of how to get your WindowsSID if you are trying to create new Windows User. The benefits of using this method is that you don’t relay to anyone to add you as a user and there is no data loss as you are adding new records to those 3 tables.

Option 4:
Adding the user using Powershell. You can open up Powershell and import a library called NavAdminTool.PS1 which can be found in NAV installation CD. This should allow you to run 2 commands that will add user into NAV database. Those two commands are: New-NavServerUser and New-NavServerUserPermissionSet. You must be logged on to the NAV server to use those two commands. This option will add a new user to the database by adding records in the required tables. It’s like option 3 in the way that it adds records into required tables and there is no data loss using when these commands.

If I was to rank these options in order of which I think is the best I would have to say that option 1 is the best because it follows standard adding users to NAV procedure and doesn’t involve any running of SQL or Powershell scripts. However, if option 1 is not available option 4 is the next best choice for me. We can look at option 4 as automated version of option 3 as it inserts records into required tables automatically instead of us having to do this manually through SQL as in option 3. I would avoid option 2 if possible as some records will be deleted from database.

Lean more about Microsoft Dynamics NAV.

Written by Edvinas Saltmiris, Dynamics NAV Consultant