The writeprivateprofstring
and
writesecuresetting
Commands
writeprivateprofstring is a general-purpose script command that writes to (or deletes from) an agent-side database.
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
writeprivateprofstring
scripts use the following syntax:
writeprivateprofstring section [key] [value]
Where:
section
is the name of the section in the.ini
file that 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. If this parameter is not entered, the key gets deleted.
key
] or the
[value
] has spaces.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
|
|
Change a device's name | writeprivateprofstring Device DeviceName MyDevice |
Change the orientation of the display image of a device that is remote controlled.
Requires:
|
writeprivateprofstring RcOrientationFix
manufacturer model value
Where
|
Specify the minimum WiFi security level on a device. Requires:
|
writeprivateprofstring DeviceFeature MinimumWifiSecurityLevel securityLevel apply featurecontrol
Where
|
Block users from removing Managed WiFi networks. Requires:
|
writeprivateprofstring DeviceFeature
DisableWiFiManagement
value
apply featurecontrol Where
|
Enable or disable 2G cellular connectivity | writeprivateprofstring DeviceFeature DisableCellular2G
{number} Where
|
Prevent users from disabling/enabling mobile data. | writeprivateprofstring DeviceFeature
DisableCellularData
value
apply featurecontrol Where
|
Control 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). 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:
|
Disable 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. |
Enable or disable ultra-wideband device connectivity | writeprivateprofstring DeviceFeature DisableUltraWideband
{number} Where
|
Reduce the number of days 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 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.
|
Specify the amount of storage devices used 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 Scripts for 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. You must restart the device for the changes
in the settings to take effect.
Description | Syntax |
---|---|
Modify device system settings Requires:
|
writesecuresetting -sys
parameter
value
See Android Developers Reference:
Examples: Use Use
|
Modifies global settings. Requires:
|
writesecuresetting -glo
parameter
value
See Android Developers Reference:
Example: Use |
Modifies secure
settings..
Requires:
|
writesecuresetting -sec
parameter
value
See Android Developers Reference:
Example: Use |