SAP Knowledge Base Article - Public

3466405 - How to use the CLI command line interface to create users and to update users

Symptom

There is a need to use command line interface to create users and update users using json formatted file. 

Environment

SAP Datasphere

Resolution

Create User

  1. Create a json file with the entries you want to create the user with, for example input.json
    [
        {
            "userName": "TESTUSER",
            "firstName": "TESTUSER_FIRSTNAME",
            "lastName": "TESTUSER_LASTNAME",
            "displayName": "TESTUSER",
            "email": "test@sap.com",
            "roles": "MSE_Scope_Role",
            "manager": ""    
        }
    ]
  2. Run the command datasphere users create -f input.json.
  3. If there is a comma missing or if there is any errors in the json file itself then CLI command line tool will fail with the error message "Failed to create a user based on an import file". Create a small json file and check with the command before trying a huge one. 

Update Users

  1. Update of only manager, email and roles is possible. Even in the user interface only update of the fields manager, email and roles is possible. The first name, last name or display name fields cannot be updated. Create a json file with the entries you want to update, for example update.json
    [
        {
            "userName": "TESTUSER",        
            "manager": "manager_name",
            "email": "test2@sap.com",
            "roles": "SCOPEROLE2"        
        }
    ]

  2. Run the command datasphere users update -f update.json
  3. The command will fail with error message "Failed to update user properties based on an import file" if the json file is wrong. Test it with small amount of data before trying for a huge number of users. 

See Also

Keywords

CLI, users, create, update, datasphere, command line , KBA , DS-DI-CON , Connections , How To

Product

SAP Datasphere 1.0