The writeprivateprofstring
and
writesecuresetting
Commands
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 and 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
script is
powerful and can impact devices significantly.Syntax
Write writeprivateprofstring
scripts using the
following syntax:
writeprivateprofstring section [key] [value]
Where:
section
is the name of the section in the.ini
file the value gets written to. The section gets created if it does not already exist. The name of the section is case-sensitive.key
is the name of the key. The key gets created if it does not exist. If this parameter is not entered, the entire section (including all entries within it) gets deleted.value
is the string that gets written to the file. The key gets deleted if this parameter is not entered.
Commands
Description | Syntax |
---|---|
Allow or block credential managers | writeprivateprofstring CredentialManagerControl AppList {package
name} apply featurecontrol
example package name: com.example.myapp |
writeprivateprofstring CredentialManagerControl
Type {number} apply
featurecontrol Where
|
|
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
|
Enables or disables 2G cellular connectivity | writeprivateprofstring DeviceFeature DisableCellular2G
{number} Where
|
Prevents users from disabling/enabling mobile data. | writeprivateprofstring DeviceFeature
DisableCellularData
value
apply featurecontrol Where
|
Controls system updates
Requires
|
Where
For windowed
Where
Tip: You can add Freeze Periods on top of your system
update policies. A freeze period stops all updates during the
specified time. When the freeze period is inactive, the regular
system update policy applies.
Freeze periods can last up to 90 days. You can set many 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 to 12 to 02 to 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 Samsung OEM devices.
Requires:
|
writeprivateprofstring DeviceFeature DisableSideKeySettings
value
apply featurecontrol Where
Example: Restriction: This script command is
only for Samsung OEM devices. |
Enables or disables ultra-wideband device connectivity | writeprivateprofstring DeviceFeature DisableUltraWideband
{number} Where
|
Reduces the number of days that script data gets retained on devices. | writeprivateprofstring ScriptExecutionInfo
ScriptOutputRetentionPeriod
value
Where Example: Restriction: This script
command applies only to devices that run scripts with the
Capture Script Status and Output option. To learn more about
the Capture Script Status and
Outputfeature, see View the Status of Sent Windows Modern Scriptsfor Windows Modern devices and View the Status of Sent macOS Scripts for macOS devices.
|
Specifies the amount of storage that devices use for script data. | writeprivateprofstring ScriptExecutionInfo
ScriptOutputMaxSize
value Where
Example:
Restriction: This script
command applies only to devices that run scripts with the
Capture Script Status and Output option. To learn more about
the Capture Script Status and Output
feature, see View the Status of Sent Windows Modern Scriptsfor Windows Modern devices and View the Status of Sent macOS Scripts for macOS 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 |