the ps command to add single users in nav is new-navserveruser. detailed info can be found here:
– https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management/new-navserveruser?view=dynamicsnav-ps-2018
– https://community.dynamics.com/nav/b/magnosblog/archive/2015/08/26/creating-users-with-powershell
i found a great ps script for bulk import:
https://marcellusnav.wordpress.com/2017/07/31/import-nav-users-from-csv-with-powershell/
to work with that, here is a tutorial:
* start the windows powershell ISE in admin mode. this is needed, because only then your are allowed to create new users in nav.
* create a csv text file with comma as separator. semicolon does not work here. save it e.g. as c:\temp\users.csv. check, if the windows users in the list are created on your server (AD).
UserName,FullName,Email
domain\user1,John,john@test.com
domain\user2,Adam,adam@test.com
* create a new text file and copy the script into the text file, save it as c:\temp\Import-NavUsersFromCSV.ps1
* in the ps ISE write “cd \temp” to change to the working directory.
* Import-Module .\Import-NavUsersFromCSV.ps1
to load the new script
* $Permissions = (‘SUPER’)
to set the default user permissionset for the new users
* at last:
Import-NavUsersFromCSV -NavVersion 100 `
-NavServerInstanceName ‘DynamicsNAV100’ `
-AuthenticationMethod Windows `
-ImportFilePath ‘C:\Temp\users.csv’ `
-PermissionSets $Permissions
result:
Creating domain\user1
Verbose: Opening admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been opened
Verbose: Ausführen des Vorgangs “New-NAVServerUser” für das Ziel “ServerInstance = MicrosoftDynamicsNavServer$DynamicsNAV100, Sid = S-1-5-21-236
3956306-4252412874-2321867446-1054, WindowsAccount = domain\user1”.
Verbose: Closing admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been closed
Verbose: Opening admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been opened
Verbose: Ausführen des Vorgangs “New-NAVServerUserPermissionSet” für das Ziel “ServerInstance = MicrosoftDynamicsNavServer$DynamicsNAV100, Permi
ssionSetId = SUPER, Sid = S-1-5-21-2363956306-4252412874-2321867446-1054, WindowsAccount = domain\user1”.
Verbose: Closing admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been closed
Creating domain\user2
Verbose: Opening admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been opened
Verbose: Ausführen des Vorgangs “New-NAVServerUser” für das Ziel “ServerInstance = MicrosoftDynamicsNavServer$DynamicsNAV100, Sid = S-1-5-21-236
3956306-4252412874-2321867446-1055, WindowsAccount = domain\user2”.
Verbose: Closing admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been closed
Verbose: Opening admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been opened
Verbose: Ausführen des Vorgangs “New-NAVServerUserPermissionSet” für das Ziel “ServerInstance = MicrosoftDynamicsNavServer$DynamicsNAV100, Permi
ssionSetId = SUPER, Sid = S-1-5-21-2363956306-4252412874-2321867446-1055, WindowsAccount = domain\user2”.
Verbose: Closing admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been closed
the “change password at next login” flag is not set. this is only set if you use the -ChangePasswordAtNextLogOn option with the New-NAVServerUser command.