Add a scripting task
Add a scripting task that N-able N-central runs at a scheduled time. You can select a script from the N-able 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)
To run a script on a macOS device, see Add a Mac scripting task.
Script file names must not contain spaces. Ensure that PowerShell is installed on the target devices before running PowerShell scripts.
If you use filters for a task, N-able N-central uses a snapshot of the filter for the targeted devices to include in the task. This avoids potential unexpected behavior when running tasks in the future. If you need to apply a task to devices, it is best to use a scheduled task profile. This enables a task to apply to the devices using a rule.
When running a script whose name contains spaces, you need to enclose the script name in quotes.
- Click Configuration > Scheduled Tasks > Add/Delete.
- Click Add > Scripting.
- Enter a Task Name.
- Select the security Credentials of the account that will be used to run the script on the device.
Select Use LocalSystem Credentials to use existing system level credentials to run the task.
Select Use Device Credentials to use existing device credentials to access the device for running the task.
Select Custom Credentials to specify a user name and password to use for this task.
If N-able N-central cannot login using the configured device credentials, it defaults to the LocalSystem credentials.
We do NOT support the use of commas in usernames and passwords.
- Select the location where the script is stored from the drop-down menu and complete the additional scripting details.
- Click the Task Handler tab and select whether the agent or probe handles the script.
- Click the Targets tab and selected the devices targeted for the policy task by selecting specific devices or using a filter.
- Click the Schedule tab and set a time when N-able N-central runs the task.
- In the Missed Executions options configure how far in the future N-able N-central should take action on a device that is currently offline, and how long it should wait, once the device powers on, before running the scheduled task.
- 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.
- Click the Notifications tab and configure N-able N-central to send a notification upon the successful completion of the task, or if the task fails to complete.
- Click Save.
The scheduled task is saved to the repository. N-able N-central runs the task at the configured time. When complete, and if configured to do so, N-able N-central sends a notification to the selected recipients in the format defined by their user profile. The script is not saved to the device after running.
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
- N-able 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.
- N-able N-central provides a combined total of 500 MB of storage for the script and software repositories.