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
- 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": ""
}
] - Run the command datasphere users create -f input.json.
- 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
- 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"
}
] - Run the command datasphere users update -f update.json
- 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
- 3461484 - How to get the Oauth token for CLI command
- Manage Users via the Command line
Keywords
CLI, users, create, update, datasphere, command line , KBA , DS-DI-CON , Connections , How To
Product
SAP Datasphere 1.0