Previous Topic

Next Topic

Book Contents

Book Index

Custom Scripts

A custom script can call any function defined by PowerShell or VBScript. PowerShell can also instantiate and invoke .NET Framework objects, and VBScript can instantiate and invoke COM objects, such as Scripting.FileSystemObject. Both types of script can run command-line applications using the MIRunCommand function.

After you save a custom script in MOVEit Automation, the script can be used in a process. Custom scripts are stored encrypted in the MOVEit Automation configuration file.

To

Do this

Create a custom script

  1. Click RESOURCES > Scripts > Add Script.
  2. Input a name in the Friendly Name field.
  3. Add a description (optional).
  4. Select the VBScript Script Type.
  5. Select a script template (optional)
  6. In the Script Source box, edit the script as needed.
  7. To save the new custom script, click Save.

    For more information, see Add New Custom Script.

Import a custom script

  1. Click RESOURCES > Scripts > Add Script.
  2. Select the Script Type. The options are VBScript or PowerShell.
  3. Click Import Script File.
  4. Locate the script and click Open.
  5. Edit the imported script in the Script Source box, if required.
  6. To save the imported script, click Save.

    The original (external) script is not affected by changes you make to the script in Web Admin.

    NOTE: If you have a custom script open in Web Admin, and you import an additional script, the source code of the new script overwrites the source code in the Script Source box. You do not receive a warning message.

Export a custom script

  1. Select an existing script or create a new script.
  2. On the script properties page, select Export from the Actions drop-down list.

    The script is exported as a VBScript (.vbs) or PowerShell (.ps1) file using the friendly name as the filename.

    For example: myscript.vbs or samplescript.sp1

Edit a custom script

  1. Select the existing script that you want to edit.
  2. On the script properties page, click Edit.
  3. Edit the required fields in the Edit Script window.
  4. To save the script changes, click Save.

    NOTE: If you change the friendly name of a script and save, that same script is saved with the new friendly name. To use an existing script as the starting point for a new script, see Use an existing custom script to create a new script in the last row of this table.

Edit a custom script in an external editor

  1. Select the existing script that you want to edit.
  2. On the script properties page, select Export from the Actions drop-down list.
  3. Open and edit the exported script in an external editor.
  4. In MOVEit Automation Web Admin, select the script name and click Edit.
  5. Click Import Script File and select the edited file.
  6. To save the script changes, click Save.

    The imported file overwrites the Script Source.

Create a new script using an existing custom script

  1. Select the existing script that you want to use to create a new script.
  2. On the script properties page, select Export in the Actions drop-down list.
  3. Create a new custom script with a unique Friendly Name.
  4. Import the exported script.
  5. To save the script changes, click Save.

See also: