{"id":76690,"date":"2023-05-19T10:37:15","date_gmt":"2023-05-19T14:37:15","guid":{"rendered":"https:\/\/jumpcloud.com\/?post_type=support&p=76690"},"modified":"2024-09-19T17:17:10","modified_gmt":"2024-09-19T21:17:10","slug":"update-users-from-csv-file","status":"publish","type":"support","link":"https:\/\/jumpcloud.com\/support\/update-users-from-csv-file","title":{"rendered":"Update Users from a CSV File"},"content":{"rendered":"\n
The JumpCloud PowerShell Module<\/a> contains two commands designed to be used in tandem to update existing JumpCloud users from a CSV file. The first command, New-JCImportTemplate<\/a>, creates the CSV update template file on the local machine populated with JumpCloud user information which admins can then add user updates to and import with the second command, Update-JCUsersFromCSV<\/a>.<\/p>\n\n\n\n <\/p><\/div> If you want to create a CSV import file instead, refer to Importing New Users from a CSV<\/a>.<\/p>\n <\/div><\/div><\/div><\/div>\n\n\n\n The JumpCloud PowerShell Module can be installed on Mac, Windows and Linux devices in a few quick steps, see our GitHub repo, Installing the JumpCloud PowerShell Module<\/a> to learn more.<\/p>\n\n\n\n Using this update workflow, JumpCloud Admins can:<\/p>\n\n\n\n By adding JumpCloud users to JumpCloud user groups, Admins can:<\/p>\n\n\n\n <\/p><\/div> Custom attributes are only presented over the JumpCloud API. Custom attributes aren’t presented over JumpCloud LDAP.<\/p>\n <\/div><\/div><\/div><\/div>\n\n\n\n The command New-JCImportTemplate<\/a> creates a blank CSV update file that can be populated with JumpCloud user information on a JumpCloud admin’s local machine.<\/p>\n\n\n\n To run the command, open a PowerShell terminal that has the JumpCloud PowerShell<\/a> module installed, and enter the PowerShell command at the prompt.<\/p>\n\n\n\n Enter “Update” to begin updating the import template file.<\/p>\n\n\n\n This file is created within the current working directory of the PowerShell session by default. To create the file in this location, enter ‘Y’. If you want to choose a different output location, enter ‘N’ and provide a full path to the folder where you want to create the file.<\/p>\n\n\n\n Question 2<\/strong><\/p>\n\n\n\n An update file can be populated with the usernames of all existing JumpCloud users. Enter “Y” at this prompt to add all existing users to the CSV update file or “N” if you do not want to add this information to the file.<\/p>\n\n\n\n Question 3<\/strong><\/p>\n\n\n\n Enter “Y” at this prompt to update existing users’ email addresses in the CSV update file or “N” if you do not want to update this information.<\/p>\n\n\n\n Question 4<\/strong><\/p>\n\n\n\n To add columns to the update file for updating extended user information attributes, enter “Y” at the prompt. Fields to update all extended user information attributes will be added to the update file. Only fields populated with information will be updated.<\/p>\n\n\n\n Question 5<\/strong><\/p>\n\n\n\n To add columns to the update file for updating location attributes, enter “Y” at the prompt. Fields to update all location attributes will be added to the update file. Only fields populated with information will be updated.<\/p>\n\n\n\n Question 6<\/strong><\/p>\n\n\n\n To add columns to the update file for updating telephony attributes, enter “Y” at the prompt. Fields to update all telephony attributes will be added to the update file. Only fields populated with information will be updated.<\/p>\n\n\n\n Question 7<\/strong><\/p>\n\n\n\n To add columns to the update file for UID\/GUID values, enter “Y” at the prompt. Columns will be added to the update file. Only fields populated with information will be updated.<\/p>\n\n\n\n Question 8<\/strong><\/p>\n\n\n\n To add columns to the update file for enabling MFA for User Portal logins and setting the number of enrollment days (enrollment period), enter “Y” at the prompt. <\/p>\n\n\n\n Question 9<\/strong><\/p>\n\n\n\n To add columns to the update file for setting the LDAP BindDN and binding users to an LDAP server, enter “Y” at the prompt. <\/p>\n\n\n\n Question 10<\/strong><\/p>\n\n\n\n By entering ‘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 a current working directory containing all JumpCloud devices and the SystemID for these devices. This file is named JCSystems_CurrentDate.csv<\/strong>.<\/p>\n\n\n\n Question 11<\/strong><\/p>\n\n\n\n If ‘Y’, <\/p>\n\n\n\n Users can be added to JumpCloud user groups during import. Note that 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 update file for group additions.<\/p>\n\n\n\n Question 12<\/strong><\/p>\n\n\n\n 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.<\/p>\n\n\n\n Question 13<\/strong><\/p>\n\n\n\n After answering all questions, the update file will be located in the current working directory of the PowerShell session. Enter ‘Y’ at this prompt to open the file in the system’s default CSV editor.<\/p>\n\n\n\n After creating a CSV update file using the steps described above, JumpCloud Admins can populate this CSV update file with their end user information and fill in the related fields for attributes, JumpCloud device bindings, or JumpCloud groups additions.<\/p>\n\n\n\n Expert Tips<\/strong><\/p>\n\n\n\n The example below is a CSV file filled out with update info for three users:<\/p>\n\n\n\n Once the update CSV template has been filled out with end user info and saved, it’s ready to be imported using the command Update-JCUsersFromCSV<\/a>.<\/p>\n\n\n\n To run the command, open a PowerShell terminal and, at the prompt, enter the PowerShell command Connect-JCOnline<\/a> and put in your JumpCloud API key to authenticate the PowerShell session to the JumpCloud API.<\/p>\n\n\n\n Considerations<\/strong>:<\/p>\n\n\n\n After successfully connecting to JumpCloud, in the terminal go to the location of the update CSV file.<\/p>\n\n\n\n The ‘dir’ command which is alias for the command Get-ChildItem<\/a> returns all the items in the current directory.<\/p>\n\n\n\n In this example you’ll see the update CSV file ‘JCUserUpdateImport_09-28-2018.csv’ is within the current directory.<\/p>\n\n\n\n\n
\n
Creating the CSV Update File<\/h2>\n\n\n\n
New-JCImportTemplate<\/code><\/p>\n<\/div><\/div>\n\n\n\n
Question 1<\/strong><\/h4>\n\n\n\n
PS \/Users\/[user]> New-JCImportTemplate <\/code><\/p>\n\n\n\n
cmdlet New-JCImportTemplate at command pipeline position 1<\/code>
Supply values for the following parameters: <\/code>
(Type !? for Help.) <\/code>
Type:<\/code><\/p>\n\n\n\n
The CSV file will be created within the directory:
\/Users\/[user]
Enter Y to confirm or N to change output location<\/code>:<\/p>\n\n\n\nWould you like to populate this update template with all of your existing users?
You can remove users you do not wish to modify from the import file after it is created.
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nWould you like to update users email addresses?
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo you want to add extended user information attributes available over JumpCloud LDAP to your users during import?
Extended user information attributes include: AlternateEmail, Manager, ManagedAppleId, MiddleName, preferredName, jobTitle, employeeIdentifier, department, costCenter, company, employeeType, description, and location
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo 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<\/code><\/p>\n\n\n\nDo 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<\/code><\/p>\n\n\n\nDo you want to set unix UID\/GUID values during import?<\/code>
UID\/GUID value attributes include: unix_uid, unix_guid
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo you want to require MFA to user?
enable_user_portal_multifactor, EnrollmentDays
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo you want to bind the user to LDAP during import
ldap_Binding_User, ldapserver_id
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo you want to bind your users to existing JumpCloud systems during import?
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nDo you want to add the users to JumpCloud user groups during import?
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nWhat is the maximum number of custom attributes you want to add to a single user during import? ENTER A NUMBER:<\/code><\/p>\n\n\n\n
Do you want to add any custom attributes to your users during import? Note, customAttribute values must be unique.
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nCreating file JCUserUpdateImport_MM-DD-YYYY.csv in the location \/Users\/[user]<\/code><\/p>\n\n\n\n
Do you want to open the file JCUserUpdateImport_MM-DD-YYYY.csv?
Enter Y for Yes or N for No:<\/code><\/p>\n\n\n\nPopulating the CSV Update File<\/h2>\n\n\n\n
\n
Update-JCUsersFromCSV<\/code> command.<\/li>\n<\/ul>\n\n\n\n
“Username”,”mobile_number”,”home_number”,”work_number”,”work_mobile_number”,”work_fax_number”
nnickerson,123-456-777,,777,,
hflax,123-456-888,,888,,
dvickers,123-456-999,,999,,<\/code><\/p>\n\n\n\nImporting the CSV Update File<\/h2>\n\n\n\n
\n
Connect-JCOnline lu8792c9d4y2398is1tb6h0b83ebf0e92s97t382
Successfully connected to JumpCloud
Module up-to-date. New LDAP attributes are live! Use Update-JCUsersFromCSV to add them in bulk.<\/code><\/p>\n\n\n\nPS \/Users\/buster\/Desktop\/Import Files> dir<\/code><\/p>\n\n\n\n
Directory: \/Users\/buster\/Desktop\/Update Files<\/code><\/p>\n\n\n\n
Mode LastWriteTime Length Name
—- ————- —— —-
—— 9\/28\/18 1:12 PM 443 JCUserUpdateImport_09-28-2018.csv<\/code><\/p>\n\n\n\n