View the Status of Sent macOS Scripts

You can view the results (including any output) of legacy scripts sent to a macOS device.

About this task

By default, when a script runs on a device, the system does not log whether the execution is successful or any other generated output. To view the results, toggle the Capture Script Status and Output feature in SOTI MobiControl. This allows you to store the script results on the device and present it on the SOTI MobiControl web console.

You can capture the results when one or more scripts are sent to a device, or when scheduling scripts in a device profile. The legacy script results can contain status, output and timestamp information. These script results can be used for testing scripts in development or investigating issues in production.

CAUTION: If device storage is a concern, be cautious about enabling this feature for all devices. Script data is not included or managed by your data collection rules (see Using Data Collection Policies).. By default, it may consume up to 100 kB of storage on a device. Configure the maximum size of the script output on a device using the following script:

writeprivateprofstring ScriptExecutionInfo ScriptOutputMaxSize [ScriptOutputMaxSize]

Tip: The default retention period for script data is 30 days on the device and 60 days on the console. To configure this retention period, send the following script:

writeprivateprofstring ScriptExecutionInfo ScriptOutputRetentionPeriod [ScriptOutputRetentionPeriod]’

Enabling Capture Script Status and Output For Sent Scripts

Procedure

Enable the Capture Script Status and Output option when you send a script to a device. See Sending Scripts to Devices. This option is available in the Send Script dialog.
Enabling Capture Script Status and Output For Sent Scripts

Enabling Capture Script Status and Output For Scheduled Scripts

Procedure

  1. Create a profile (seeCreating a Profile) and choose the Task Scheduler configuration.
  2. In the Task Scheduler window, select Capture script status and output.
    Enabling Capture Script Status and Output For Scheduled Scripts

Viewing Script Status and Output Data

Before you begin

You can only see data from scripts that were semt with the Capture Script Status and Output enabled.

About this task

The following video demonstrates how to view script results.

Procedure

  1. Open the Devices view from the SOTI MobiControl console.
  2. Select a device to open its Device Information panel. The Device Information panel appears.
  3. Navigate to the Scripts tab. This tab lists all scripts sent to the device and indicates if they executed successfully or failed.
    Scripts tab of the Device Information panel
  4. Select the Details button of the script. The Script Details panel appears. The Script Viewer field displays the script.
    Script table from the Scripts tab
  5. In the Script Details window, select Request Output to download the script data from the device.
    Request Output button from the Script Details panel
    If the device is online, the script results download. Otherwise, the data downloads the next time the device is available online. The data appears in the Script Details window.
  6. To refresh the data, select the refresh button. An Output tab appears. Select this tab to view the generated output.
    Output tab of the Script Details panel
    Tip: To direct the output of a script into a text file when using the latest agent (version 2024.1.0), administrators must execute the following script on the intended device:

    sudo chmod 666 /Users/username/Desktop/name of the file.txt

    Important: For the execution of multiline scripts using the latest agent (version 2024.1.0), administrators must encapsulate the script within the following block tags:

    <SYSTEM_SCRIPT_BLOCK> # Your multiline script goes here </SYSTEM_SCRIPT_BLOCK>

Results

You have viewed the results of a script sent to a macOS device using the SOTI MobiControl web console.