Create actions

DOC configuration: Security Controls > System Management > Actions

Create an action to execute a PowerShell or batch script on managed computers. You can then use the action in remote tasks, compliance enforcement rules, or event configurations. For more information, see Actions.

Create an action

  1. Select the policy in which you want to create the action.

  2. Click + and select the required action type:

    • Create new action 'PowerShell script'...

    • Create new action 'Batch script'...

  3. Under Basic properties, enter a name for the action and, if necessary, add a comment. Make sure the Active option is enabled.

  4. Go to Script and enter the script to execute. Alternatively, you can load an existing script file.

    Example of a PowerShell script that creates a text file in the temporary directory:

    param(

    [string]$Message = "Test"

    )

    $path = Join-Path $env:TEMP "ScriptTest.txt"

    "Message: $Message" |

    Out-File -FilePath $path -Encoding UTF8

    Configure the additional script settings as needed:

    • Use PowerShell parameter syntax: Specifies whether PowerShell parameter syntax is used.

    • Maximum execution time: Specifies how long the agent waits at most for the script to finish. The default is 60 seconds.

    • Terminate script when maximum execution time is reached: Terminates the script if the maximum execution time is exceeded.

    • Treat child processes as part of the script: Also takes child processes started by the script into account during execution.

    • Run as the currently logged-on user: Runs the script in the context of the logged-on user.

  5. Starting with version 2026.2, the execution time of PowerShell and batch scripts is limited. The default is 60 seconds. This also applies to existing actions. Therefore, check the maximum execution time of existing actions and adjust it if necessary. If Terminate script when maximum execution time is reached is enabled, the script is terminated when this time expires.

  6. Go to Parameters and click + to add a parameter.

    Enter a name and, optionally, a description, and select the appropriate type. Confirm with OK.

    For the example script, create a parameter named Message with the Text type. You can specify the parameter value later when using the action. If no value is passed, the example script uses the default value Test.

  7. Go to Validity and specify which computers the action applies to. For more information, see Validity.

  8. Click Save and close.

The action is then available for selection when you create a remote task, a compliance enforcement rule, or a corresponding event configuration.