Search code examples
windowsmicrosoft-dynamicserpnavision

How to add another windows user to MS Dynamics NAV valid user?


I installed MS Dynamics NAV from my windows admin account and It's running successfully on admin login. But when I login from another account and start NAV(2016), It shows :

you do not have access to microsoft dynamics nav .verify that you have been setup as a valid user in ms dynamics NAV.

I can't install NAV setup from my windows account as It don't have permission to install anything.

I am totally new to it, need help.


Solution

  • Step 1 - You will need the Windows Security ID or SSID

    Open powershell and paste the below code

    $objUser = New-Object System.Security.Principal.NTAccount("YourDomain\Your ID")
    $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
    $strSID.Value
    

    Replace YourDomain\Your ID with your Your Domain and USER ID.

    Run the code and in the output, you will find the SSID.

    STEP 2 - ENTER USER Details in NAVISION Database with Roles.

    Open SQL Server Management Studio.

    In My Case the database that i want to get access is Demo Database NAV (7-1).

    Click on New Query and paste below listed command in the query window.

    USE [DATABASE NAME]
    DECLARE @USERSID uniqueidentifier, @WINDOWSSID nvarchar(119), @USERNAME     nvarchar(50), @USERSIDTXT varchar(50)
    
    SELECT NEWID()
    SET @USERNAME   = 'YourDomain\Your ID'
    SET @USERSID    = NEWID()
    SET @USERSIDTXT = CONVERT(VARCHAR(50), @USERSID)
    SET @WINDOWSSID = 'Your SSID'
    
    INSERT INTO [dbo].[User]
    ([User Security ID],[User Name],[Full Name],[State],[Expiry Date], [Windows     Security ID],[Change Password],[License Type],[Authentication Email])
    VALUES
    (@USERSID,@USERNAME,'',0,'1753-01-01 00:00:00.000',@WINDOWSSID,0,0,'')
    
    INSERT INTO [dbo].[User Property]
    ([User Security ID],[Password],[Name Identifier],[Authentication Key],    [WebServices Key],[WebServices Key Expiry Date],[Authentication Object ID])
    VALUES
    (@USERSID,'','','','','1753-01-01 00:00:00.000','')
    
    INSERT INTO [dbo].[Access Control]([User Security ID],[Role ID],[Company     Name])
    VALUES
    (@USERSID,'SUPER','')
    GO
    

    Replace DATABASE NAME - with your database name YourDomain\Your ID - with your Domain Name & User Name Your SSID - with SSID as copied in STEP 1

    The Query provide SUPER Role to user, if required you can change the Role in the Last part of the query.