Tuesday, March 8, 2016
In previous blog post I explained how to configure NAV service instance with Credential Type NavUserPassword. As this part is already valid, trusted and signed, users can be created and Windows client launched.
Read more details of how to create users using PowerShell in this post:
I have restored new NAV2016 Cronus database (named NAV9) and then needed to create users to test this database running Windows client with at least two users.
Nav Service Instance (named TestNAV2016) with Credential Type NavUserPassword was configured and runned for restored database (find more details how it was done here).
In SQL Server Management Studio
- Go to the "Security" directory of your database
- Right-click the Users directory and select "New User..."
- In General Tab: add 'NT AUTHORITY\NETWORK SERVICE' as a new User name and Login name; Select dbo as Default schema
- In the Data Role Membership Tab, select db_owner
- Click OK
Run Poweshell ISE as Administrator and type following comands (adjust parameters in blue):
powershell.exe set-ExecutionPolicy RemoteSigned
Import-Module "C:\Program Files\Microsoft Dynamics NAV\90\Service\Microsoft.Dynamics.Nav.Management.psm1"
Get-NAVServerInstance -ServerInstance TestNAV2016 | Set-NAVServerInstance -Restart
New-NAVServerUser TestNAV2016 -UserName TESTUSER -Password (Read-Host "Enter password for User1" -AsSecureString) -AuthenticationEmail testuser@xxx.com -Verbose
- #enter Password for this user in upcoming Window
New-NAVServerUserPermissionSet -PermissionSetId super -ServerInstance TestNAV2016 -UserName TESTUSER -Verbose
- #In case of error use comand to remove nav user
Remove-NAVServerUser -ServerInstance TestNAV2016 -UserName TESTUSER
Run NAV Windows Client and enter User name and Password and access database with first user TESTUSER.
In order to loggin to same database with second user enter following comands to Powershell ISE
New-NAVServerUser TestNAV2016 -UserName TESTUSER2 -Password (Read-Host "Enter password for User1" -AsSecureString) -AuthenticationEmail testuser2@1xxx.com -Verbose
- #enter Password for this user in upcoming Window
New-NAVServerUserPermissionSet -PermissionSetId Super -ServerInstance TestNAV2016 -UserName TESTUSER2 -Verbose
Run NAV Windows Client and enter new User name and Password and access database with second user TESTUSER2.