The Import Users feature is used both to import batches of new users, and to update or delete existing users.
Duo's Import Users tool imports user information from a properly formatted comma-separated values (CSV) file. This streamlined process makes it easy to create, update, or delete many users at the same time.
CSV import values can include username aliases, email addresses, full names, groups, notes, and multiple phones or mobile devices. Manage users created via import from the Duo Admin Panel immediately after being created. This differs from the Bulk Enroll Users tool, in that those entries are initially limited to username and email address, and those users cannot be managed in Duo until they've completed self-enrollment.
Role required: Owner, Administrator, or User Manager.
The CSV file can include multiple data fields for each Duo user.
The fields allowed in this CSV file are:
username field is mandatory; all other fields are optional, and can be arranged in any order (as shown in the CSV File Format section below). Duo usernames and username aliases should have unique values for each user.
Required. The Duo username. May include spaces, numbers, and punctuation.
If the username specified already exists in Duo, then the import updates that user. If the username does not exist as a username or username alias, then the import creates a new user. If the username already exists as the username alias for another user, the import fails to create or update that user.
The user's full name. May include spaces, numbers, and punctuation.
Specify up to eight additional usernames for each Duo user as
The username alias values must be unique. If the alias already exists for a different user as either the username or alias, the import fails to update the user.
The user's email address, as a correctly formatted SMTP address (
The phone number may include spaces, dashes, or parentheses; all non-numeric characters are deleted during import. If the phone number includes an extension, the extension can be preceded by either a
Multiple phones can be attached to a user by including columns for
If you include a
Add the user to the specified Duo group upon import. The import process automatically creates the group if it doesn't exist (with "Active" status), with the user as a member.
A single user can be added to multiple groups by including columns for
Importing with status
Note that the effective status for an imported user may be affected by the user's group memberships and the status assigned to those group(s). If, for example, a user was imported with
Free-text information about the user, with a maximum length of 512 characters. May include spaces, numbers, and punctuation.
The first line of the CSV file (the header) specifies the fields to import. For example:
Here are some examples of possible user entries in this CSV file using the example header. Notice that when there is no value for a field, the field is left blank.
username,realname,alias1,alias2,alias3,alias4,email,status,phone1,platform1,phone2,group1,group2 jason,Jason Smith,email@example.com,firstname.lastname@example.org,jason.smith,smithj,email@example.com,,734-555-1234,Android,734-555-4343x222,Stdusers, sally,Sally Jones,firstname.lastname@example.org,,,,email@example.com,Bypass,734-555-1235,,,StdUsers, jack,Jack Johnson,firstname.lastname@example.org,,,,email@example.com,,734-555-4322,Mobile,440-555-1234,Stdusers,NetAdmins mary,,,,,,,delete,,,,,
Here is a sample CSV file that you can use as a template for creating your own.
The CSV file size should not exceed 1 MB. If you need to import many users, split the information up into multiple CSV files of 1 MB or less and import each one separately.
When you import a user with the same username as an existing Duo user who is not already managed by directory sync, the imported values for user details (like
CSV import does not modify or update user attributes values imported by directory sync. CSV import can update attributes that aren't configured for import by directory sync, and can also update a user's status to "Active" or "Bypass" when the user's status is not "Disabled" before the import.
Once you've created your CSV file, you're ready to import your users.
Log in to the Duo Admin Panel and click Users in the left sidebar.
Click the Import Users button near the top of the page. Now click the Choose File button, browse to your CSV file, and select it. Click Upload to start the import process.
If the CSV file contains any errors, the import attempt fails and you are shown a red error message like the one below. If you see an error message, then the attempt has failed and none of your users were imported. Correct the indicated errors and try the import again.
Wait for the import to complete. Importing users via CSV can take some time, particularly if there are a large number of entries. You can leave the Import Users page running in the background. Periodically check back or refresh the page for progress updates, which will appear in a bar near the top of the Import Users page:
Note: Only one CSV import can be running at any given time.
After the CSV import is finished, a success message at the top of the Duo Admin Panel reports the results:
There are few circumstances under which an import can succeed even though updates to one or more accounts failed. An example of this is attempting to delete an account that does not exist. These will be noted in the success message.
Remember: When you import a user with the same username as an existing Duo user, values for user details specified in the CSV file (like
For example, suppose you have a Duo user with the username
TestUser1 who has no other information associated with the account. If you were to import a CSV containing a row with the same username (
TestUser1), but this time also including a real name, username alias, email address, phone number, etc., this information would replace the existing (blank) details for that user, create a new phone with the imported number and platform, and associate that new phone with the existing user.
username,realname,alias1,email,status,phone1,platform1 TestUser1,Test User 1,tuser1,firstname.lastname@example.org,,734-555-1234,Android
The situation is the same if the Duo user has existing information. Suppose some properties for
TestUser1 are already populated, like username alias, real name, email address, phone numbers, groups, etc. Now you want to add this user to a new group,
TestGroup1. If you modify your CSV to include this new
group value for
TestUser1 (but leave all other values as they were), the user is added to the new group while keeping all other information intact. This can be done for any number of users in a CSV file, and for any of the fields.
username,realname,alias1,email,status,phone1,platform1,group1 TestUser1,Test User 1,tuser1,email@example.com,,734-555-1234,Android,TestGroup1
Note that you can't remove group memberships or attached phones for a user via CSV import, only add additional group memberships and phones.
If you want to delete an existing Duo user, you can do so by setting the user's
delete in the CSV file. If that user is the only user attached to a specific phone, then the phone will also be deleted from Duo when the CSV file is imported.
username,status jason,delete sally,delete jack,delete mary,delete
After importing new users, the next step is to activate their devices for use with Duo. If you defined the users' device platforms as part of the import, then the Users page displays a bar indicating that some users have not yet activated Duo Mobile. Clicking the link in this bar starts the process of sending activation links. You can choose which users you want to receive links, and whether to send the activation via email or text.
For more information on user activation for imported users, see Activating Duo Mobile After Enrollment.