Add a scripting task

Add a scripting task that SolarWinds N-central runs at a scheduled time. You can select a script from the SolarWinds N-central repository or upload a script from your local system. Scripts can be one of:

  • batch file (.bat)
  • PowerShell (.ps1)
  • Visual Basic (.vbs, .vb, or .vbe)
  • AppleScript
  • BASH

Script file names must not contain spaces. Ensure that PowerShell is installed on the target devices before running PowerShell scripts.

When running a script whose name contains spaces, you need to enclose the script name in quotes.

This procedure can only be performed at the Service Organization level or Customer level.

  1. Click ConfigurationScheduled TasksAdd/Delete.
  2. Click AddScripting.
  3. Enter a Task Name.
  4. Select the security Credentials of the account that will be used to run the automation policy.
  5. Select the location where the script is stored from the drop-down menu and complete the additional scripting details.
  6. Click the Task Handler tab and select whether the agent or probe handles the script.
  7. Click the Targets tab and selected the devices targeted for the policy task by selecting specific devices or using a filter.
  8. Click the Schedule tab and set a time when SolarWinds N-central runs the task.
  9. If a device is offline, you can set it to run the task within a determined number of days since boot up.

    On a recurring task, you can also set the task not to run the scheduled task if the next occurrence of the task will be launched near the time of the recurring schedule, to avoid conflicting task windows.

  10. Click the Notifications tab and configure SolarWinds N-central to send a notification upon the successful completion of the task, or if the task fails to complete.
  11. Click Save.

The scheduled task is saved to the repository. SolarWinds N-central runs the task at the configured time. When complete, and if configured to do so, SolarWinds N-central sends a notification to the selected recipients in the format defined by their user profile.

If you choose to edit the task, the edits may not be applied to the task if it has been initiated. Edits are applied to completed tasks only if they are recurring tasks.

Scripting considerations

  • SolarWinds N-central does not verify syntax and command line parameters of scripts or MSI/EXE installers to ensure that they are correct. You must validate scripts and MSI/EXE installers before using them in scheduled tasks to ensure that they will function properly.

    Command line parameters for MSI installers must be in the format of: <filename> </i or /u> </additional parameters>. For example, MyInstaller.msi /i /qn. The following examples are invalid: MyInstaller.msi /qn or /i MyInstaller.msi /qn.

  • If execution of a script requires user input, it must be specified in the Command Line Parameters field when the task is created.
  • SolarWinds N-central provides a combined total of 500 MB of storage for the script and software repositories.