How to import users in EEM using command line?

Document ID : KB000049699
Last Modified Date : 14/02/2018
Show Technical Document Details

Solution:

  1. Login to the EEM web interface at https://localhost:5250/spin/eiam/eiam.csp. Be sure to login with the Service Desk application instance which by default is ServiceDesk-<machine name>. Login using the ServiceDesk userid and password that was set during configuration.

  2. Go to Manage Identities Tab and create a sample user

    Name: Test User
    First Name: Test
    Last Name: User

    Add the desired Group Membership that you want to set as default for all the users that you are going to populate.

    Set the Password and save the contact.

  3. Go to Configure Tab -> EEM Server -> Export Application

  4. Select the below from the Export Application windows and click the export button to

    1. Global Users

    2. Global User Groups

    3. Global Folders

    4. Users

    5. User Groups

    6. Folders

  5. A file name with ServiceDesk[1].xml.gz extension would be saved. You can use Winzip to extract the .xml file.

  6. Open the ServiceDesk[1].xml in any text editor.

  7. Search for below lines
    <GlobalUser folder="/" name="Test User"><UserName>Test User</UserName><PasswordDigest>9ce84f3e{MD5}uUo9dH0Vb6AJCEGwDC+KJQ==</PasswordDigest><DirectoryPasswordDigest>{SHA}wLE3/i15JFnyb/djzORFdKW1qwM=</DirectoryPasswordDigest><PasswordChangeDate>1271379036</PasswordChangeDate><FirstName>Test</FirstName><LastName>User</LastName></GlobalUser>

  8. To add the user "New User" copy the tags from <GlobalUser folder="/" name="Test User"> to </GlobalUser> just below the above lines and replace them as below
    <GlobalUser folder="/" name="New User"><UserName>New User</UserName><PasswordDigest>9ce84f3e{MD5}uUo9dH0Vb6AJCEGwDC+KJQ==</PasswordDigest><DirectoryPasswordDigest>{SHA}wLE3/i15JFnyb/djzORFdKW1qwM=</DirectoryPasswordDigest><PasswordChangeDate>1271379036</PasswordChangeDate><FirstName>New</FirstName><LastName>User</LastName>

  9. Do not change the PasswordDigest / DirectoryPasswordDigest / PasswordChangeDate tags

  10. Search for below lines
    <User folder="/" name="Test User"><GroupMembership>Workflow Administrators</GroupMembership><GroupMembership>Workflow Process Initiators</GroupMembership></User>

  11. To add the persmissions for "New User" copy the tags from <User folder="/" name="Test User"> to </User> just below the above lines and replace them as below
    <User folder="/" name="New User"><GroupMembership>Workflow Administrators</GroupMembership><GroupMembership>Workflow Process Initiators</GroupMembership></User>

  12. Save the .xml file

  13. Browse to Program Files\CA\SharedComponents\iTechnology> directory from the command prompt

  14. Run the below command to populate the new user
    safex -u ServiceDesk -p <<password>>  -f  <<xml filename>>

  15. The new user will now be added and the password would be similar to default to the one that was created for the Test User

Note: This is just a workaround suggested and we would recommend you to fully test it on a test environment before doing on the production. The CA recommend way to populate users is to either manually create it using the interface or integrate EEM with LDAP.