Sending MDM Commands

What

FileWave Anywhere can send MDM commands to devices, and the FileWave Anywhere API can trigger those same commands for scripted or integrated workflows.

The Swagger documentation shows the request structure:

image.png

Note the reference to the device(s) is now by 'ids'.  This refers to the Client ID, as opposed to the Device ID, and is always an Integer.

Example data could look like:

{
  "ids": [
    737581
  ],
  "command": "DeviceInformation"
}

'ids' is a list of devices, so multiple devices could be targeted in one RESTful API command.

Commands sent by the API will show in the device's Client Info:

image.png

HOW

This is an example of a RESTful API request that is only available through the FileWave Anywhere API.

Running the command from the Swagger Documentation will show the URL path required to send a command.  For example, to lock devices:

macOS and Linux:

mdm_command='{"ids": [737581, 562620],"command": "DeviceLock"}'

curl -H "Authorization: $auth" \
  -X POST https://${server_dns}/api/devices/v1/devices/mdm-command \
  -d "$mdm_command" \
  -H "Content-Type: application/json"

Windows PowerShell:

$mdm_command = '{"ids": [737581, 562620],"command": "DeviceLock"}'

$header = @{Authorization="$auth"}

Invoke-RestMethod -Method POST \ 
    -Headers $header \
    -ContentType application/json \
    -Uri https://${server_dns}/api/devices/v1/devices/mdm-command \
    -Body $mdm_command

What commands are available

From the Swagger, there is the following text:

Command options can be specified in 'options' field of the request for the following commands: DeviceLock,
EraseDevice, SetFirmwarePassword, VerifyFirmwarePassword, UnlockUserAccount, RestartDevice.

Acceptable options for each command are listed in Apple documentation: https://developer.apple.com/documentation/devicemanagement/commands_and_queries

Some commands have been listed, but the link to Apple's documentation shows all possible commands:

If a new command is released by Apple before it appears in FileWave, the API should be able to trigger that command

To use Apple's documentation, navigate through the pages for the chosen command to locate the 'RequestType'.  For example, the following shows the command to shut a device down is: ShutDownDevice

image.png


Revision #9
Created 2023-07-05 14:42:20 UTC by Sean Holden
Updated 2026-05-20 12:51:34 UTC by Josh Levitsky