Skip to content

How ro run a raw command using runscript in BatchAdminCommand? #981

Answered by jshcodes
budachst asked this question in Q&A
Discussion options

You must be logged in to vote

I want to run a dscl on macOS to change some user's password. I successfully did that using a single id as a target using a service class. I am trying to get that working using an uber class approach, but the command alsways gets rejected with this error

40006, 'message': 'Command is not valid'. I am constructing my BODY payload like this:

{
  "base_command": "runscript",
  "command_string": "-Raw=```dscl . -passwd /Users/someuser %s```" % (newPW),
  "batch_id": "BATCHID",
  "optional_hosts": [
    "HOST1",
    "HOST2"
  ],
  "persist_all": true
}

If I leave the -Raw= and the backticks out, the command gets executed and the result returned, but I need the -Raw option, since I want to ru…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@budachst
Comment options

Answer selected by budachst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
RTR Real Time Response issues and questions API usage General API usage issues and questions
2 participants