I'm using the not-very-well-documented computercommands API to trigger device locks during termination events. I got it working on a test device last week, but it has not sent out the command to two separate devices in PROD just today even though when I run the script in verbose it returns a 200 from JSS.
Does anyone else use this API or seen something similar?
Here is my code:
$ch = curl_init($uri);
$curlOptions = array(
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json'
),
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => "$jssUser:$jssPass",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_VERBOSE => true, // Enable verbose output
);
curl_setopt_array($ch, $curlOptions);
$result = curl_exec($ch);
print_r($result);
Page 1 / 1
Youre getting a 200 code because the API has successfully queued the MDM command!
What does the management log say on the device? (Computer Inventory > Management > Management Commands)? Is the command pending or showing as failed?
If there is nothing there, whats showing under the Computer Inventory > History > Management History? Can you find the command at all?
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.