Using the following script commands, admin can create jobs on SureMDM that can be pushed to Zebra devices to manage device peripherals remotely. You can create a Run Script job in SureMDM using the steps mentioned below and apply it to desired enrolled devices.
Purpose
The purpose of this knowledge article is to know how to remotely configure Zebra devices using scripts.
Prerequisites
For Zebra devices, installing the OEM Agent is essential to unlock and utilize all advanced management features effectively.
To request the OEM Agent app, please contact the 42Gears Technical Support team at techsupport@42gears.com.
Steps to create a Run Script job
1. On SureMDM Home, click Jobs.
2. On the Job screen, click New Job.
3. On the Select the OS screen, select Android.
4. On the Select Job Type screen, select Run Script.
5. On the Run Script prompt, enter the script and click OK.
6. Once done, use Apply option on SureMDM Home to apply the Run Script job to desired Zebra device(s).
Run Scripts for Zebra Devices
Using predefined scripts, admin can create jobs on SureMDM that can be pushed to Zebra devices to manage device peripherals remotely. Find below the scripts to remotely configure hardware peripherals of Zebra devices:
Note:
For Zebra devices, admins can directly apply the XML generated run scripts with ” “ ” or ” ‘ ” using the following command. !#suremdmzebra
For example:The runscript for Zebra devices can be written in the following ways:
!#suremdm
zebra(<wap-provisioningdoc><characteristic type=”CameraMgr” version=”4.3″><parm name=”UseAllCameras” value=”1″/></characteristic></wap-provisioningdoc>)
or!#suremdm
zebra(<wap-provisioningdoc><characteristic type=’CameraMgr’ version=’4.3′><parm name=’UseAllCameras’ value=’1’/></characteristic></wap-provisioningdoc>)
This feature works on the devices running SureMDM version 19.51 or later.Remote Reboot from the Console
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='PowerMgr' version='4.2' > <parm name='ResetAction' value='4'/> </characteristic></wap-provisioningdoc>)
Factory Reset
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='PowerMgr' version='4.2' > <parm name='ResetAction' value='6'/></characteristic></wap-provisioningdoc>)
Clock Manager: Set Time, Date, Auto Time, Time zone
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='Clock' version='4.2' ><parm name='AutoTime' value='false'/><parm name='TimeZone' value='GMT-4'/><parm name='Date' value='2018-07-09'/><parm name='Time' value='10:25:33'/> </characteristic></wap-provisioningdoc>)
Enable/Disable Bluetooth, NFC, WIFI, Airplane Mode
Bluetooth Enable/Disable
Note: value 1 = enable , 2 = disable
Enable Bluetooth
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='WirelessMgr' version='4.3' > <parm name='BluetoothState' value='1'/></characteristic></wap-provisioningdoc>)
Disable Bluetooth:
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='WirelessMgr' version='4.3' > <parm name='BluetoothState' value='2'/></characteristic></wap-provisioningdoc>)
NFC Enable/Disable
Note: value 1 = enable , 2 = disable
Enable NFC
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='WirelessMgr' version='4.3' > <parm name='NFCState' value='1'/></characteristic></wap-provisioningdoc>)
Disable NFC
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='WirelessMgr' version='4.3' > <parm name='NFCState' value='2'/></characteristic></wap-provisioningdoc>)
Wi-Fi Enable/Disable
Note: value 1 = enable , 2 = disable
Enable Wi-Fi
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='SettingsMgr' version='4.4'><parm name='WifiSettingsUI' value='1'/></characteristic></wap-provisioningdoc>)
Disable Wi-Fi
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='SettingsMgr' version='4.4'><parm name='WifiSettingsUI' value='2'/></characteristic></wap-provisioningdoc>)
Airplane Mode Enable/Disable
Note: value 1 = enable , 2 = disable
Enable Airplane Mode
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='SettingsMgr' version='4.4'><parm name='AirplaneMode' value='1'/></characteristic></wap-provisioningdoc>)
Disable Airplane Mode
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='SettingsMgr' version='4.4'><parm name='AirplaneMode' value='2'/></characteristic></wap-provisioningdoc>)
Display Manager: Timeout
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='DisplayMgr' version='5.0' ><parm name='TimeoutInterval' value='200'/></characteristic></wap-provisioningdoc>)
Enable/Disable Settings and Notifications
Note: value 1 = enable , 2 = disable
Enable Settings icon from Notification panel
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='5.1' ><parm name='NotificationSettings' value='1'/></characteristic></wap-provisioningdoc>)
Disable Settings icon from Notification panel
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='5.1' ><parm name='NotificationSettings' value='2'/></characteristic></wap-provisioningdoc>)
Enable notification pull down
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='5.1' ><parm name='NotificationPullDown' value='1'/></characteristic></wap-provisioningdoc>)
Disable notification pull down
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='5.1' ><parm name='NotificationPullDown' value='2'/></characteristic></wap-provisioningdoc>)
UI Manager – Enable/Disable Clipboard, Clear Clipboard, Enable/Disable Home Key
Note: value 1 = enable , 2 = disable
UI Manager – Enable Clipboard
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='4.3' ><parm name='ClipBoardUsage' value='1' /></characteristic></wap-provisioningdoc>)
UI Manager – Disable Clipboard
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='4.3' ><parm name='ClipBoardUsage' value='2' /></characteristic></wap-provisioningdoc>)
UI Manager – Clear Clipboard
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='UiMgr' version='4.3' ><parm name='ClipBoardClear' value='true'/></characteristic></wap-provisioningdoc>)
UI Manager – Enable Home Key
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='4.3' ><parm name='HomeKeyUsage' value='1'/></characteristic></wap-provisioningdoc>)
UI Manager – Disable Home Key
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UiMgr' version='4.3' ><parm name='HomeKeyUsage' value='2'/></characteristic></wap-provisioningdoc>)
Disable Peripheral Services (USB and Camera)
Note: value 1 = enable , 2 = disable
Enable USB
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UsbMgr' version='4.2' ><parm name='UsbModuleUsage' value='1'/> </characteristic></wap-provisioningdoc>)
Disable USB
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='UsbMgr' version='4.2' ><parm name='UsbModuleUsage' value='2'/> </characteristic></wap-provisioningdoc>)
Enable Camera
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='CameraMgr' version='4.3' ><parm name='UseAllCameras' value='1'/></characteristic></wap-provisioningdoc>)
Disable Camera
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='CameraMgr' version='4.3' ><parm name='UseAllCameras' value='2'/></characteristic></wap-provisioningdoc>)
Set Wi-Fi Sleep Policy to be Always On
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='Wi-Fi' ><characteristic type='System'><parm name='WiFiAction' value='enable'/><parm name='WifiSleepPolicy' value='AlwaysOn'/></characteristic><parm name='UseRegulatory' value='0'/><parm name='UseDiagnosticOptions' value='0'/><parm name='UseAdvancedOptions' value='0'/></characteristic></wap-provisioningdoc>)
OS Upgrade
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='PowerMgr' version='4.2' ><parm name='ResetAction' value='8'/><characteristic type='file-details'><parm name='ZipFile' value='path_of_the_file'/></characteristic></characteristic></wap-provisioningdoc>)
!#suremdm zebra(<wap-provisioningdoc><characteristic version="7.2" type="PowerMgr"><parm name="ResetAction" value="8" /><characteristic type="file-details"><parm name="ZipFile" value="/storage/em/zipfile.zip" /></characteristic></characteristic></wap-provisioningdoc>)
Note: Minimum MX version required is 7.2
Silent Application Uninstallation
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic version='4.2' type='AppMgr'><parm name='Action' value='Uninstall' /><parm name='Package' value='com.packagename' /></characteristic></wap-provisioningdoc>)
Silent Application Upgrade
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='AppMgr' version='4.2' ><parm name='Action' value='Upgrade'/><parm name='APK' value='/sdcard/surelock.apk'/></characteristic></wap-provisioningdoc>)
Blacklist System Applications
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic version='4.2' type='AppMgr'><parm name='Action' value='DisableApplication' /><parm name='Package' value='com.packagename'/></characteristic></wap-provisioningdoc>)
Whitelist Third-party Applications
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic version='4.2' type='AppMgr'><parm name='Action' value='EnableApplication' /><parm name='Package' value='com.android.calendar'/></characteristic></wap-provisioningdoc>)
Install and Uninstall Certificates
Install Cerificates
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='CertMgr' version='4.2' ><parm name='CertAction' value='1'/><characteristic type='cert-details'><parm name='CertAlias' value='mxtest'/> <parm name='CertType' value='5'/><parm name='CertMethod' value='2'/><parm name='CertFileCA' value='/sdcard/DCIM/42GRootCA.cer'/><parm name='CertAdjustClock' value='false'/></characteristic></characteristic></wap-provisioningdoc>)
Uninstall Certificates
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc><characteristic type='CertMgr' version='4.2' ><parm name='CertAction' value='2'/><characteristic type='cert-details'><parm name='CertAlias' value='mxtest'/></characteristic></characteristic></wap-provisioningdoc>)
Enable/Disable Unknown Sources
Note: value 1 = enable , 2 = disable
Enable Unknown Sources
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='DevAdmin' version='4.3' ><parm name='UnknownSourcesStatus' value='1'/> </characteristic></wap-provisioningdoc>)
Disable Unknown Sources
am broadcast -a com.gears42.enterpriseagent.zebra_sdk -e script zebra(<wap-provisioningdoc> <characteristic type='DevAdmin' version='4.3' ><parm name='Unknon
Set Lock Screen Password as None
!#suremdm zebra(<wap-provisioningdoc><characteristic version="6.0" type="DevAdmin"><parm name="ScreenLockType" value="5" /></characteristic></wap-provisioningdoc>)