In this guide we outline how you can add Script Packs to your Naverisk Instance that have been downloaded from the Routine Store. Then how to create your own from either a Batch, VB or PowerShell Script.
1.0 The Routine Store
In the Settings Tab > Remote Management Settings > you will find our Routine Store:
In here you will find a Naverisk Community Archive of Shared Script Packs as well as Script packs developed and uploaded by the Naverisk Team.
Please always take extra care when using Scripts. Test them first on one of your Devices to make sure the behaviour of the Scripts is as you intend, making necessary changes to suit your needs.
Select a Script you would like to download:
It is best practice to always read the notes of the Script Pack you intend to download to see if there are any extra steps needed to run effectively.
Select Download this Routine:
You have now downloaded a Script Pack to your physical PC.
2.0 Adding a Script Pack
Steps to add a script pack
Navigate to Settings and then Script Packs.
Here is where you will load the Script Pack onto Naverisk.
Click the Upload Script Packs button as highlighted below.
A Window will pop up asking you to navigate to where you have the file on your machine, navigate to it and then click Open.
Now the Script Pack is loaded into Naverisk.
You can also find Batch, VB and PowerShell Scripts online (i.e. via Google) however if you choose to do this please examine these Scripts before applying them so you understand exactly what they do.
3.0 Creating a Script Pack
To create a Naverisk Script you will first need to create a Batch, VB or PowerShell Script. In this example I will use a simple Batch for releasing and renewing the IP address of a device as well as Flushing its DNS.
Create the list of commands you wish to have in your Batch file; below is an example of a Reset Network Batch file;
2. Once you have created your Batch file, you can now upload it to your Naverisk, creating a Naverisk Script Pack.
3. Navigate to Settings > Script Packs and select New Script Pack.
You will now be presented with the New Script Pack box as per the below screenshot:
Client – choose the Client you want the Script Pack to be created under.
Name – choose the name of the Script Pack
Description – an optional field to be filled in when you are creating a Script Pack
Agent Type – specify the Operating System that the script is designed to run on
Shared - indicated if this script pack is available to sub-clients
Upload Files – you can upload a number of files into a Script Pack, even an .exe file. Selecting Primary will ensure that the intended file gets run first.
Parameters – if you have created a Script that requires input of Parameters when the Script is executed, you can insert them in this field.
Once you have finished filling all of the required fields, please remember to select Save.
4.0 Editing Script Packs
Existing script packs can be easily edited and updated as required. To edit a script pack, go to Settings > Script Packs, and click the Edit icon by the desired script pack
You can also edit script packs before running or scheduling them using the edit button after you have selected the script pack.
In the editor, you can modify the script pack name, description and parameters if required. Installer files, scripts and text files attached to the script pack can be added or deleted using the Add or Delete buttons. The primary file selection can also be changed
Any script or text file attached to the script pack can be edited using the Edit icon.
This opens a text editor where you can modify the script or file. Note that the editor is for text based files only. Attempting to edit executable file or archives may cause corruption of the file.
Once you have finished editing the contents of the file, click save and the edited version will be updated into the script pack, overwriting the previous version.
You can also change the name of the script file. This will result in a new copy of the file being added to the script pack using the updated name.
Once you have finished editing files, click the Save button to save your changes,
5.0 Applying Script Packs
From here you want to navigate back to Devices and then select the Device to which your Script is to be applied to.
Once the Devices have been selected, from the drop-down menu Select a Task, please select Run Script Packs.
Next you will want to select Run Script Pack From the drop-down if it is not already selected and then click the button that says Run.
Only Script Packs designated for your Operation System (Windows/Linux/Mac) will be available for selection.
If desired, you can modify the parameters for the script, for example add a license key for a software install script. You can also edit the script pack by clicking the Edit button.
After you have done that you will see that it will say Pending Package.
Once complete it will say Finished and Display Results, which you can then click on to see what the Script has done.
You can also schedule Scripts at specified time(s) to run from Scheduling. When creating the Scheduled Job, you can specify an Alert Recipient to email upon completions of the job, as well as which Devices to apply the Script to.
Scripts can also be run on a single Device from within the Device Details panel. From the selected Device, from the drop-down menu if Device Tasks, please select Run Script Packs.
6.0 Encountered Errors & Solutions
There can be various reasons why a Script fails to run. Please check the following:
Is the right file set as the Primary in the Script pack?
Can you execute the script on your computer manually?
Is it executing as the correct user?
Are there any identifiable errors?
A common error with PowerShell scripts can be:
“File xxx.ps1 cannot be loaded because the execution of Scripts is disabled on this system”
This indicates that the execution policy of PowerShell on this particular Device is too restrictive to permit Naverisk PowerShell Scripts to run.
To resolve this please run the following command in PowerShell for that Device:
Set-ExecutionPolicy RemoteSigned
This permits any Scripts parsed locally to run, but only allows Scripts downloaded from the internet to run if they have been signed by a trusted publisher.
Please note that Naverisk is a 32bit application and some scripts may need to call Sysnative rather than System32. If you have any questions around this please contact support@naverisk.com.