Import Users in Bulk

  • Import Users in Bulk

    Posted by DSC Communities on June 11, 2018 at 3:31 pm
    • Valarie Wiles

      Member

      June 11, 2018 at 3:31 PM

      Does anyone have a powershell command to import bulk users into NAV without the need to manually create new users one by one?

      ——————————
      Valarie Wiles
      Goodwill Southeast Georgia
      Savannah GA
      ——————————

    • Franz Kalchmair

      Member

      June 11, 2018 at 3:54 PM

      the ps command isĀ new-navserveruser.Ā 
      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

      ps script for bulk import.Ā 
      https://marcellusnav.wordpress.com/2017/07/31/import-nav-users-from-csv-with-powershell/

      ——————————
      Franz Kalchmair
      Microsoft MVP
      Senior Consultant
      Austria, Europe
      ——————————
      ——————————————-

    • Valarie Wiles

      Member

      June 11, 2018 at 4:52 PM

      Thanks. I found that article, too. I’ll follow the steps and see how itĀ  goes!

      ——————————
      Valarie Wiles
      Goodwill Southeast Georgia
      Savannah GA
      ——————————
      ——————————————-

    • Franz Kalchmair

      Member

      June 12, 2018 at 12:54 PM

      according to your message. i did the following:

      * i starte the windows powershell ISE in admin mode. this is needed, because only then your are allowed to create new users in nav

      * then created a csv text file with comma as separator. semicolon does not work here. saved it as c:tempusers.csv. check, if these windows users are created on your server (AD).

      UserName,FullName,Email
      domainuser1,John,john@test.com
      domainuser2,Adam,adam@test.com

      * created a new text file and copied the script into the text file, saved it as c:tempImport-NavUsersFromCSV.ps1

      * in the ps ISE i wrote then “cd temp” to change to my 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:Tempusers.csv’ `
      -PermissionSets $Permissions

      result:
      Creating domainuser1
      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 = domainuser1″.
      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 = domainuser1″.
      Verbose: Closing admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’
      Verbose: Admin connection to ServerInstance ‘MicrosoftDynamicsNavServer$DynamicsNAV100’ has been closed
      Creating domainuser2
      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 = domainuser2″.
      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 = domainuser2″.
      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.

      ——————————
      Franz Kalchmair
      Microsoft MVP
      Senior Consultant
      Austria, Europe
      ——————————
      ——————————————-

    • Mathew Ealy

      Member

      June 13, 2018 at 7:15 AM

      The script needs edited to map to your nav powershell modules.Ā 
      MEaly58/Nav_Powershell

      #CSV format
      <#!
      FullName,Login,Email,Profile,
      You can find the user profiles in your system on table “User Personalization (2000000073)”
      #>
      #Import the NavAdmin Module
      Import-Module “C:Program FilesMicrosoft Dynamics NAV90ServiceNAVAdminTool.ps1″
      #Nav version changes the 90 to a differnt number
      #Import the CSV file **Change the -path to the file
      $Users = Import-CSV path “\serversharefile.csv”
      #Variables
      $InstanceName = “NavInstance”
      #Execute script
      foreach ($User in $Users)
      {
      $FullName = $User.‘FullName’
      $Login = $User.‘Login’
      $Email = $User.‘Email’
      $Profile = $User.‘Profile’
      New-NavServerUser ServerInstance $InstanceName WindowsAccount $Login FullName $FullName ProfileID $Profile
      }

      ——————————
      Mathew Ealy
      Nav Support Specialist
      Rentokil N. America
      Reading PA
      ——————————
      ——————————————-

    DSC Communities replied 7 years, 2 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Import Users in Bulk’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!