Bulk Importing of users into the Local User database

Christopher Dakin

If you have opted to use the built-in Local User database with LogonBox, you may wish to do a bulk import of your user accounts to the system.

This article shows how you can use the Automations feature to import these users from a CSV file.

 

Create the CSV file

In Excel or similar, first you need to create the CSV file containing your list of users.

As a minimum you will need to have the usernames, but it's recommended to have the full name, email and optionally mobile numbers.

The file can be created with or without a header line. For example, we have 10 users listed in this file.

 

Make a note of the number of columns in the file and also the Quote Character (used when a value contains special characters) and the Delimiter Character (which separates your values).

For excel our defaults for Quote and Delimiter will work so you do not need to discover these.

 

Create the Import CSV automation task

Now we need to set up the task to import the CSV that has been created.

Click on Automations under Business Rules on the left menu, then click Create.

 

On the Create Automation page, give this automation a name, such as Create local users from CSV.

For the task, start typing Import CSV and select it from the list when it becomes visible.

This will open up the configuration for the import. On the Options tab, enter the Quote and Delimiter characters if they differ from the defaults (Excel CSV files do not need any changes).

 

Click the Source tab, then set the Source dropdown to UPLOAD.

Next to Source Upload, click the Choose file button then select your CSV file. This will upload your file to the server.

For Columns, enter the number of columns of the file that you noted earlier.

Set Contains Headers to the correct value for your file.

 

As this automation will be a one time task, we do not need to configure any of the other tabs, so at this point you can click the Create button.

 

Create the Import Users task

Now we have the import task, we need to tell LogonBox what to do with the file, so we will chain this task to another automation (or trigger).

On the Automations page, click the + symbol next to the Import task that was just created.

This will show this task as a module. Click the  icon in that module to chain a new automation off this one.

 

You will now see a new Create Automation page that has an Event of Import CSV already filled out for you.

Give this new automation a name, for example Import Users, then set the Triggers On to Success (we only want this to run if the Import CSV task completed).

For Triggers Task, start typing Create Local User, then select it from the list when it appears. This opens up the settings for that task.

 

We won't be setting any conditions on this trigger, so click on the Credentials tab.

The Principal Name will be the username, so make a note of which column this is in your CSV file. Then click the ${} button and select the corresponding column value.

For this example the username is column one, so we select ${attr.column1}.

Set the rest of the settings on this tab to your own preferences.

Send Notification: Emails every user that they have a new account on the system (and also contain their password so they can actually log on).

Force Password Change: Asks the user to change their password the first time they log on to the system.

Generate Password: If set to ON it will generate a random password for each user. If OFF, then you can either have a hard coded password for each user, or import the password from CSV by using a column attribute.

 

You may add the user to groups using a collumn attribute in the Groups tab (If you want to add multiple groups, you need one group in each column and you can add multiple column attributes).

For this example, we will not add any groups.

Click on the Details tab. Here we can set the users' Fullname, Email and Mobile.

Again, using the ${} selector, find the appropriate columns for each value (or leave blank if you will not be using this).

 

You may also add in additional email or mobile numbers in the Additional Contacts tab, but for this example, we will leave that blank.

Click Create to complete this trigger. The Automation now shows that the Import task is linked to the CSV import.

 

Running the import

Now we have the automation set up (and we didn't set a schedule), we now have to run the task.

To do this, click on the green play icon.

 

The Automation will now run and you should see notifications on the bottom right of the screen (and events in the Audit Log).

 

Looking in Access Control->Users we can now see that our users were imported.