Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Create a user and then update it
*/
private static void createUserExample() {
Service splunkService = connectAndLoginToSplunkExample();
String username = "testuser";
String password = "changeme";
String[] roles = { "power", "testrole" };
User user = splunkService.getUsers().create(username, password, roles);
// refresh state from server
user.refresh();
// Change some properties and update the server
user.setRealName("Test User");
user.setRoles("can_delete");
user.setDefaultApp("launcher");
user.setTz("US/Pacific");
user.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.