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
MD
Matt Dermody Diamond Contributor
2 years ago

You mention not being able to use the SOTI time zone sync since devices are in different time zones. That sounds like all of the devices are in one main group instead of being separated by time zone or physical location. Do you have the ability to create sub groups that are time zone specific and place the devices into the separate groups? Or are the devices physically moving across time zones regularly (e.g. devices in vehicle)?

If the devices are not physically moving could you use IP address subnet as a proxy for physical locations? If you can tie subnet to physical location you could use relocation rules to relocate devices into time zone specific subgroups. 

UM
Umid Mahmood
2 years ago

The devices are stationary so separating the devices into groups is possible but a time consuming process due to our naming convention on the devices. I was hoping that i could manipulate this variable somehow location_time_zone_detection_enabled through the SOTI platform but i'm feeling this may be more complicated than I thought. 

ZC
Zafer Cigdem
2 years ago

Hi Umid,

You may use Virtual Group by using either available filter (if it matches to your use cases) or using custom attribute/custom data option to categorize and filter the related devices to set different time zones such as UTC+1, UTC+2 depending on your Virtual Groups. 

You may find more information about custom attribute on SOTI Help pages, or here: SOTI Discussion Forum

I hope it helps. Thank you

Zafer

MD
Matt Dermody Diamond Contributor
2 years ago

If devices are stationary can you rely on their IP address subnet to infer location? If so you can easily automate the automatic relocation of devices into time zone based subgroups. It would not be time consuming at all.

ZC
Zafer Cigdem
2 years ago

Agreed, if it is possible to rely on IP or somehow using custom data based on another valid condition for possible automation, I'd prefer relocation rule as well. 

KW
Katie Williams
a year ago

What if the devices are physically moving across time zones? This is the issue I'm running into.

RC
Raymond Chan Diamond Contributor
2 years ago

Hi Umid,

How many devices do you have in your system?

If you have an Excel spreadsheet of which devices are in which time-zone, I believe it is not difficult to create a CSV file involving your defined custom attribute and time-zone value for the whole list of devices.  You can then perform a bulk import of CA value with the CSV file to your MobiControl server.  

After that, you can use device filter or virtual group filter to manually/automatically relocate devices of different time-zones to corresponding device groups.

M
MPMOD@SOTI
2 years ago

Hi Umid,

Thank you for posting on SOTI Pulse! 

Has any of the other suggestions helped you?

I would suggest that you try creating virtual groups as Zafer has mentioned. If you are experiencing any issues with doing this, feel free to open up a case with Soti Support.

Kind regards,

Technical Support Specialist | SOTI | +1 905.624.9828 | SOTI.net lDiscussion Forum | Log a Case OnlineLinkedIn