Example: Using the Configuration XML File Import/Export Feature to Add Multiple Users

This example shows how to use the configuration XML file import/export feature. The example is illustrative. There are additional ways to use export files.

Assume you have just added a new device to the network, and you want to add your 2,000 users to the system. Instead of adding them one at a time in the admin console, you want to perform a mass import You can export the user accounts, extract the relevant XML that defines users, replicate each element as needed, and then import them. In this situation, your configuration should include the option to force the users to change their passwords the first time they log in to the system.

In this procedure, you only see examples for User 1, User 2, and User 2000. All other users are included in your import file. You set the passwords to numbered instances of the word password, such as password1, password2, and so on. All users in this example are assigned to the same auth server, although you can specify any combination of auth servers that are valid on your system.

To add multiple new users:

  1. Select Maintenance > Import/Export > Export XML.
  2. Follow the instructions to export local user accounts.
  3. Save the exported file as users.xml.
  4. Open the users.xml file.
  5. Copy and paste the User container element repeatedly until you have added the necessary number of users. Although the example shows only three new users, you might add hundreds of new users to the file.
  6. Update the appropriate data in each User container element as shown in “Example: Updating the User container”.
  7. Save the users.xml file.
  8. Select Maintenance > Import/Export > XML Import/Export > Import.
  9. Click Browse to locate and select your users.xml file.
  10. Click Import.

    Example: Updating the User container
    <configuration xmlns="http://xml.juniper.net/ive-sa/6.2R1"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <authentication>

      <auth-servers>

       <auth-server>

        <local>

         <users>

             <user>

            <username>user1</username>

            <fullname>User1</fullname>

            <password-cleartext>password1


            </password-cleartext>

            <one-time-use>false</one-time-use>

            <enabled>true</enabled>

            <change-password-at-signin>true


            </change-password-at-signin>

          </user>

             <user>

             <username>user2</username>

          <fullname>User2</fullname>

          <password-cleartext>password2


          </password-cleartext>

          <one-time-use>false</one-time-use>

          <enabled>true</enabled>

          <change-password-at-signin>true


          </change-password-at-signin>

         </user>

         <name>System Local</name>

       </auth-server>

      </auth-servers>

    </authentication>

    </configuration>

Related Topics