Support Center

Importing Users into JumpCloud from CSV

Importing Users From a CSV File

The JumpCloud PowerShell Module contains two CSV import specific commands designed to be used in tandem for importing users into JumpCloud from a CSV file. The first command creates the .CSV import template file on the local machine which admins then populate with their end-user information and import with the second command.

  • Need to install the module? The module can be installed on Mac, Windows, and Linux in a few quick steps.

Using this import workflow JumpCloud admins can:

  • create JumpCloud users
  • add JumpCloud users to JumpCloud user groups
  • bind JumpCloud users to JumpCloud systems with either standard or admin system permissions
  • add custom attributes* to JumpCloud users

By adding JumpCloud users to JumpCloud user groups during import admins can:

  • grant JumpCloud users access to JumpCloud SSO applications
  • grant JumpCloud users permissions to JumpCloud System Groups
  • add JumpCloud users to JumpCloud LDAP and Radius
  • add JumpCloud users to the JumpCloud Office 365 or G Suite directory level integrations
    • takeover existing or provision new user accounts in Office 365 or G Suite

* Custom attributes are only presented over the JumpCloud API. Custom attributes are not presented over JumpCloud LDAP.

Step 1: Creating the CSV import file

The command New-JCImportTemplate creates a blank CSV import file on a JumpCloud admins local machine.

To run the command open a PowerShell terminal and at the prompt enter the PowerShell command

New-JCImportTemplate 

After running the command New-JCImportTemplate admins will be asked a series of interactive questions in the terminal that will define the CSV column headers created in the blank CSV import file created as an output of the command.

  • Need to install the module? The module can be installed on Mac, Windows and Linux in a few quick steps.

New-JCImportTemplate Questions:

Question 1

The CSV file: JCUserImport_03-14-2015.csv Will be created within the directory: /Users/buster
Enter Y to confirm or N to change JCUserImport_03-14-2015.csv output location: 

The .CSV import file is named JCUserImport_CurrentDate.csv

This file is by default created within the home folder of the logged in user.

To create the file in this location press 'Y'.

If you wish to choose a different output location press 'N' and provide a full path to the folder where you wish to create the file.

Question 2

Do you want to bind your new users to existing JumpCloud systems during import? 
Enter Y for Yes or N for No: 

JumpCloud users can be bound to JumpCloud systems during import. In order to leverage this feature, the JumpCloud agent must first be installed on the systems you wish to manage. JumpCloud systems are identified by their SystemID.

By pressing 'Y' at this prompt you'll be asked for your JumpCloud API key. This API key will be used to authenticate to the JumpCloud API to create a .CSV file in the home folder of the logged in user that contains all JumpCloud systems and the SystemID for these systems. This file is named JCSystems_CurrentDate.csv.

Question 3

Do you want to add the new users to JumpCloud user groups during import? Enter Y for Yes or N for No: 

Users can be added to JumpCloud User groups during import. Note if you wish to add users to groups these groups must already be created within the JumpCloud admin console. Enter 'Y' at this prompt to add columns in the CSV import template for group additions.

Do you want to add the new users to JumpCloud user groups during import? Enter Y for Yes or N for No: y 

What is the maximum number of groups you want to add a single user to during import? ENTER A NUMBER: 

If 'Y' is entered enter a numeric value for the MAXIMUM number of groups you wish to add a single user to. For example, if I wished to add my imported users to four groups 'Denver', 'AllEmployee', 'Office365', and 'Admins' I would enter '4' at this prompt. Note this does not mean that I have to add all imported users to four groups.

Question 4

Do you want to add any custom attributes to your users during import? Enter Y for Yes or N for No: 

Custom attributes are only presented over the JumpCloud API. Custom attributes are not presented over JumpCloud LDAP. Enter 'Y' at this prompt if you wish to add custom attributes to your users during import.

Do you want to add any custom attributes to your users during import? Enter Y for Yes or N for No: y What is the maximum number of custom attributes you want to add to a single user during import? ENTER A NUMBER: 

If 'Y' is entered enter a numeric value for the MAXIMUM number of attributes you wish to add a single user to. For example, if I wished to add three attributes 'Favorite Food', 'Birthday', and 'Emergency Contact' I would enter '3' at this prompt. Note this does not mean that I have to add three attributes to all users.

Creating file JCUserImport_03-14-2015.csv in the location /Users/buster 
Do you want to open the file JCUserImport_03-14-2015.csv? Enter Y for Yes or N for No:

After answering all questions the import file will be located in the home directory of the logged in user. Enter 'Y' at this prompt will open the file in the system's default CSV editor.

Step 2: Populating the CSV import file

After creating a CSV import template using the steps described above JumpCloud admins can populate this CSV import file with their end-user information and fill in the related fields for custom attributes, JumpCloud system associations, or JumpCloud groups.

Expert tips

  • JumpCloud usernames and email addresses must be unique for each JumpCloud user a single username or email address cannot be used twice.
  • If end user information lives in an external directory it may be advantageous to export this information to a CSV format and then copy and paste this information into the import CSV file to save time.
  • It is very important the column headings names are not modified or edited as these values are dependencies for the Import-JCUsersFromCSV command.

Find below an example CSV file filled out with information for three users

FirstName,LastName,Username,Email,Password Nate,Nickerson,nnickerson,nnickerson@sabre.com,P@ssword1! Holly,Flax,hflax,hflax@sabre.com,P@ssword1!@ 
Deangelo,Vickers,dvickers,dvickers@sabre.com,P@ssword1! 

Users created without a password specified in the CSV import file will receive a JumpCloud account activation email.

  • If you wish to create your users without them receiving an activation email from JumpCloud be sure to set a temporary password for each user.
  • Post user import you can manually send activation emails via the 'resend email' button item in the admin console or by adding the user to the G-Suite or Office365 sync

Step 3: Importing the CSV import file

Once the import CSV template has been filled out with end-user information and saved it is ready to be imported using the command Import-JCUsersFromCSV

To run the command open a PowerShell terminal and at the prompt enter the PowerShell command Connect-JCOnline and pass in your JumpCloud API key to authenticate the PowerShell session to the JumpCloud API.

  • Your JumpCloud API key can be found in the JumpCloud admin console within 'API Settings' accessible from the drop-down icon next to the admin email address in the top right corner of the JumpCloud admin console.
Connect-JCOnline lu8792c9d4y2398is1tb6h0b83ebf0e92s97t382
Successfully connected to JumpCloud 
Module up-to-date. Check out the new parameters on Get-JCCommandResult https://git.io/jc-pwsh-releasenotes Module version: 1.4.2 

After successfully connecting to JumpCloud navigate in the terminal to the location of the import CSV file.

PS /Users/buster/Desktop/Import Files> dir 
Directory: /Users/buster/Desktop/Import 
Files Mode LastWriteTime Length Name
 ---- ------------- ------ ---- ------ 
3/14/15 9:26 AM 535 JCUserImport_03-14-2015.csv 

The 'dir' command which is an alias for the command Get-ChildItem returns all the items in the current directory.

In this example, you will see the import CSV file 'JCUserImport_03-14-2015.csv' is within the current directory.

Next, run the Import-JCUsersFromCSV command and enter the full path to the CSV import file to the -CSVFilePath parameter.

  • If you have navigated to the directory where the CSV file lives in the PowerShell session all that must be entered for this parameter is the name of the CSV import file.
Import-JCUsersFromCSV -CSVFilePath JCUserImport_03-14-2015.csv

The CSV file will be validated to ensure that there are no username or email address collisions and any systems or groups that are being added will be validated to ensure they exist.

After validation admins will be presented with a 'Y'/'N' prompt to confirm the import or quit

Import Summary: 
 
    Number Of Users To Import = 3 
 
    Would you like to import these users?
 
Press Y to confirm or N to quit:

If 'Y' is entered admins will be presented with an import summary after the import completes.

Hang tight! Creating your users. DO NOT shutdown the console. 
 
Feel free to watch your user count increase in the JumpCloud admin console!
 
It takes ~ 1 minute per 100 users. 
 
Username : nnickerson 
Status : User Created 
UserID : 5b4781bce3c61c2f3940f2b6 
GroupsAdd : {} 
SystemID : 
SystemAdd : 
 
Username : hflax 
Status : User Created 
UserID : 5b4781bc4907674a1e7bc382 
GroupsAdd : {} 
SystemID :
SystemAdd : 
 
Username : dvickers 
Status : User Created 
UserID : 5b4781bd23e457661be364ca 
GroupsAdd : {} 
SystemID : 
SystemAdd :


JumpCloud also provides a precompiled binary within our API Utility rollup. Download the latest rollup on  GitHub , the uncompressed package will contain the file CSVImporter_ os_arch.

CSVImporter Usage

Linux / Mac OS X:
# ./CSVImporter_darwin_amd64
Usage of ./CSVImporter:
  -csv="": -csv=<filename>
  -key="": -key=<API-key-value>

# ./CSVImporter_darwin_amd64 -csv="PATH_TO_CSV" -key="YOUR_API_KEY"


Windows:
PS C:\Users\Administrator\Downloads> .\CSVImporter_windows_amd64.exe
Usage of ./CSVImporter:
  -csv="": -csv=<filename>
  -key="": -key=<API-key-value>

PS C:\Users\Administrator\Downloads> .\CSVImporter_windows_amd64.exe -csv="PATH_TO_CSV" -key="YOUR_API_KEY"

Building the CSV File


NOTES:  
  • The column headers in row one are for reference only and should be removed before attempting import
  • A minimum 9 fields are required
  • Username and email are required, if SUDO Access is left blank, the user will be granted Global Administrator
  • Email addresses must be all lowercase
  • If the password is not set, the user will receive an email to complete registration. Setting the password will bypass that step and immediately activate the user.

Importing a User Only




The exported CSV should look like this:
,,jdoe,jdoe@example.com,,,FALSE,,

NOTE:  Some spreadsheet programs may not output commas when the column has no values, e.g., Google Sheets will include the comma if each column in the first row has a space, then the file downloaded as csv.  As noted, the row with column headings should be deleted prior to import.

Other Fields
UID / GID (optional): If the global setting 'Keep UID consistent across all servers' is enabled in Settings, the UID and GID will be automatically assigned. Otherwise, specify the desired values.
 
 

Last Updated: Jul 12, 2018 11:13AM MDT

Related Articles
31b11a79e2c94470a66430cfe6d3eecd@jumpcloud.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete