Automating Set Timezone based on Location setting

UM
Umid Mahmood
COTTON ON AUSTRALIA PTY. LTD.

I have fleet of samsung devices that are on the wrong time zone, I cannot use soti's time sync option as these devices are across different time zones. All my woes would be solved if this script would work but as the last line is attempting to edit a secure setting and not a global setting it is getting a permissions error. (Set timezone based on location is off by default on multiple devices) 

writesecuresetting -glo auto_time 1
writesecuresetting -glo auto_time_zone 1
writesecuresetting -sec location_time_zone_detection_enabled 1

The error from the ADB logs is below 

script-executor|E|DO|[net.soti.mobicontrol.script.s0.n:37] Failed to exec script command: writesecuresetting [-sec, location_time_zone_detection_enabled, 1]|java.lang.SecurityException: Permission denial: Device owners cannot update location_time_zone_detection_enabled

Anyone have any ideas on automating this a different way?

2 years ago
Android Scripting
ANSWERS