I am looking to change the Device Name and Friendly Name of iOS devices to a different value via the Rest-API. I am able to change the Friendly Name like this:
$requestHeaders = @{
'Accept' = 'application/json'
'Authorization' = $auth
'aw-tenant-code' = $wsoApiKey
}
$body = @{
'DeviceFriendlyName' = $WsoDeviceName
}
$body = ConvertTo-Json $body
$uri = $wsoApiUri + $WsoDevice.Id.Value
Invoke-RestMethod -Uri $uri -ContentType "application/json; charset=utf-8" -Headers $requestHeaders -Body $body -Method Put
But I can't seem to find the correct attribute to change the Device Name, neither in the local API help (at server.local/api/help), nor in vmwares documentation. Sending a PUT-request to change the DeviceName or DeviceReportedName shows no changes whatsoever. The code for that looked like:
$body = @{
'DeviceName' = $WsoDeviceName
}
I am aware of the possibility to set the Friendly Name as Device Name via the web interface. Maybe there is a way to activate that option via API, that I did not find? In this case it would get the job done.
Would be glad, if someone could point me in the right direction.
Best regards
Holewasch
I was able to accomplish this using a custom MDM command. In the example below, I specifically use the
POST /devices/commandsmethod while searching by a serial number for the device.