The writeprivateprofstring
Command
writeprivateprofstring
is a general purpose
script command that writes to (or deletes from) an agent side database. The
writeprivateprofstring script's behavior depends on the
device family and whether a device has an agent or not, as follows:
Device Family | Script Behavior |
---|---|
Windows Mobile and Desktop | Writes to the registry under the PDB registry path, as well as to
the pdb.ini file. |
Android | Writes to the agent's internal database file. |
Linux | Writes to the pdb.ini file
in the agent's installation directory. |
writeprivateprofstring
is a
powerful script. Use with caution.Syntax
Write writeprivateprofstring
scripts using the following syntax:
writeprivateprofstring section [key] [value]
Where:
section
is the name of the section in the.ini
file to which the value will be written. If the section does not exist, it will be created. The name of the section is case-sensitive.key
is the name of the key. If the key does not exist in the specified section, it will be created. If this parameter is not entered, the entire section (including all entries within it) will be deleted.value
is the string to be written to the file. If this parameter is not entered, the key will be deleted.
Examples
Description | Syntax |
---|---|
Changes a device's name | writeprivateprofstring Device DeviceName MyDevice |
Changes the orientation of the display image of a device that is remote controlled.
Requires
|
writeprivateprofstring RcOrientationFix manufacturer model value
Where
|
Specifies the minimum WiFi security level on a device
Requires
|
writeprivateprofstring DeviceFeature MinimumWifiSecurityLevel securityLevel apply featurecontrol
Where
|
Blocks users from removing Managed WiFi networks. Requires:
|
writeprivateprofstring DeviceFeature
DisableWiFiManagement
value
apply featurecontrol Where
|
Prevents users from disabling/enabling mobile data. | writeprivateprofstring DeviceFeature
DisableCellularData
value
apply featurecontrol Where
|
Controls system updates
Requires
|
Where
For windowed
Where
Note: You can add Freeze Periods on top of your system update policies. A freeze period stops all updates during the specified time frame. When the freeze period is inactive, the regular system update policy applies.
Freeze periods can last up to 90 days. You can set multiple freeze periods but they cannot overlap and there must be at least 60 days between freeze periods. Freeze periods can cross year boundaries so you can set a freeze that lasts from 12-12 to 02-13 (December 12 to February 13). Supported on Android 9 and later. To set a freeze period, add this command: Where
Then, for each freeze period add:
Where
Examples: To postpone a system update for 30 days:
To set a maintenance window between 1 and 6 AM for system updates with a summer holiday and a winter holiday freeze period:
|
Disables the side key on Samaung OEM devices. Requires
|
writeprivateprofstring DeviceFeature DisableSideKeySettings
value
apply featurecontrol Where
Example: Limitation: This script command is only for Samsung OEM devices. |
writesecuresetting
The writesecuresetting
script command changes the
values in the Android Device Settings database. Restart the device to effect the
changes in settings.
Description | Syntax |
---|---|
Modifies device system settings
Requires
|
writesecuresetting -sys
parameter
value
To see a list of available parameters, visit Android Developers Reference:
Examples Use Use |
Modifies global settings
Requires
|
writesecuresetting -glo
parameter
value
To see a list of available parameters, visit Android Developers Reference:
Example Use |
Modifies secure settings.
Requires
|
writesecuresetting -sec
parameter
value
To see a list of available parameters, visit Android Developers Reference:
Example Use |