Import Users from CSV with the PowerShell Module

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 administrators then populate with their end user information and import with the second command.

Note:

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 administrators can:

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

By adding JumpCloud users to JumpCloud user groups during import, administrators 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 Microsoft 365 or Google Workspace directory integrations
    • take over existing user accounts or provision new user accounts in Microsoft 365 or Google Workspace

Considerations:

  • Each user you import must be a unique user with a unique email address.
  • The user state assigned to these imported users, staged or active, is determined by the setting under: Settings > User Management > Default User State for User CreationCSV Import / Bulk User API Import
  • Don’t import users that you don’t intend to manage with JumpCloud. You have 48 hours to remove unwanted users and to contact your Technical Account Manager to avoid being charged for any users you remove after import. 
  • You can also import users via CSV in the Admin Portal. See Add Users to the Admin Portal.
  • Custom attributes are only presented over the JumpCloud API. Custom attributes aren’t presented over JumpCloud LDAP.

Important:

Active users created with a password aren’t sent an activation email on CSV import. If you do NOT want JumpCloud to send emails to your users, you MUST set user passwords. Note that emails will never be trigger for users created as staged.

Creating the CSV Import File

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

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

New-JCImportTemplate

After running the command, administrators will be asked a series of interactive questions in the terminal. The answers to these questions will define the column headers that are added to the CSV template file that is created by this command. The questions that are asked are shown below.

Question 1

The CSV file will be created within the directory:
/Users/buster
Enter Y to confirm or N to change output location:

This file is created within the current working directory of the PowerShell session by default.

  • To create the file in this location, press Y.
  • If you want to choose a different output location, press N and provide a full path to the folder where you want to create the file.

Question 2

Do you want to create an import CSV template for creating new users or for updating existing users?
Enter "N" for to create a template for new users
Enter "U" for creating a template for updating existing users
Enter N for 'new users' or U for 'updating users':

  • To create a CSV new user import file, press N.
  • If you want to create a CSV update file instead, press U at this prompt and refer to the article Update Users from a CSV File.

Question 3

Do you want to add extended user information attributes available over JumpCloud LDAP to your users during import?
Extended user information attributes include: MiddleName, preferredName, jobTitle, employeeIdentifier, department, costCenter, company, employeeType, description, and location
Enter Y for Yes or N for No:

  • To add columns to the import file for adding extended user information attributes, enter Y at the prompt.
    • Fields to import all extended user information attributes will be added to the import file.
    • Only fields populated with information will be imported.

Question 4

Do you want to add extended user location attributes available over JumpCloud LDAP to your users during import?
Extended user location attributes include: home_streetAddress, home_poBox, home_city, home_state, home_postalCode, home_country, work_streetAddress, work_poBox, work_city, work_state, work_postalCode, work_country

  • To add columns to the import file for adding location attributes, enter Y at the prompt.
    • Fields to import all location attributes will be added to the import file.
    • Only fields populated with information will be imported.

Question 5

Do you want to add extended user telephony attributes available over JumpCloud LDAP to your users during import?
Extended user telephony attributes include: mobile_number, home_number, work_number, work_mobile_number, work_fax_number

  • To add columns to the import file for adding telephony attributes, enter Y at the prompt.
    • Fields to import all telephony attributes will be added to the update file.
    • Only fields populated with information will be imported.

Question 6

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 devices during import. To leverage this feature, the JumpCloud agent must first be installed on the devices you want to manage. JumpCloud devices 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 devices, as well as the SystemID for these systems. This file is named JCSystems_CurrentDate.csv.

Question 7

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 want to add users to groups, these groups must already be created within the JumpCloud Admin Portal. 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 to which you want to add a single user. For example, if I wanted to add my imported users to groups Denver, AllEmployee, Microsoft 365, and Admins, I would enter 4 at this prompt.

Note:

This doesn’t mean that I have to add all imported users to four groups.

Question 8

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 aren’t presented over JumpCloud LDAP. Enter Y at this prompt if you want 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 to which you want to add a single user. For example, if I wanted to add attributes Favorite Food, Birthday, and Emergency Contact, I would enter 3 at this prompt.

Note:

This doesn’t 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 to open the file in the system's default CSV editor.

Populating the CSV Import File

After creating a CSV import template using the steps described above, JumpCloud administrators 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.

Tip:
  • JumpCloud usernames and email addresses must be unique for each JumpCloud user. A single username or email address can’t be used twice.
  • If a custom attribute “WorkdayID” is added to the CSV template, each input value must be unique per user. For more information about Workday users, see Integrate with Workday.
  • If end user information lives in an external directory, it may be advantageous to export this information to a CSV format, then copy and paste this information into the import CSV file to save time.
  • It’s very important that the column headings names aren’t modified or edited, as these values are dependencies for the Import-JCUsersFromCSV command.
  • If binding users to systems, the ‘Administrator’ field takes a “$True/$False” value.
    • When set to $True, users will be given administrator permissions.
    • When set to $False, users will be set as standard users.
    • If left blank, users will be created as standard users by default. 

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

FirstName,LastName,Username,Email,Password,Nate,Nickerson,nnickerson,[email protected],P@ssword1! Holly,Flax,hflax,[email protected],P@ssword1!@,Deangelo,Vickers,dvickers,[email protected],P@ssword1!

Importing the CSV Import File

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

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

Note:

Your JumpCloud API key can be found in the JumpCloud Admin Portal within API Settings, accessible from the icon in the top right corner of the JumpCloud Admin Portal.

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.

Note:

If you've 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, administrators will be presented with a Y/N prompt to either 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, administrators 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 :

Pre-Compiled Binary

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.

Using CSVImporter

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

Considerations:

  • A minimum of nine (9) fields is required.
  • Username and email are required.
  • If SUDO Access is left blank, the user will be granted Global Administrator permissions.
  • Email addresses must be all lowercase.
  • If the password isn’t set, the user will receive an email to complete registration. Setting the password will bypass that step and immediately activate the user.

Importing Only a User

The exported CSV should look like this:
,,jdoe,[email protected],,,FALSE,,

Note:

Some spreadsheet programs might not output commas when the column has no values. One possible workaround is to add a space in the empty column. A space can be used for an empty value to overcome this.

Other Fields

  • (Optional) UID/GID: If the global setting Enable UID/GID management for users is enabled in Settings, the UID and GID will be automatically assigned. Otherwise, specify the desired values.
Back to Top

Still Have Questions?

If you cannot find an answer to your question in our FAQ, you can always contact us.

Submit a Case