Product Documentation

Using Windows Task Scheduler to Create vDisk Update Task Scripts

Sep 28, 2016
Windows Task Scheduler can be used to create vDisk Update task scripts. These scripts are associated with a task when the Update Task Wizard is run and can later be modified on the Scripts tab of the vDisk Update Task Properties dialog.
Note: Features of the Task Scheduler are used to run the batch file/script as the desired user.

The following types of task scripts can be created:

  • Pre-update script - executes prior to the start of any update task process.

  • Pre-startup script - executes just before starting the virtual machine.

  • Post-shutdown script - executes just after the virtual machine shuts down.

  • Post update script - executes after the update task process completes.

Scripts are stored in a Scripts folder, which is a sub-folder of the product installation folder.

A sample batch file to boot target devices:

Mcli SetupConnection /p server=192.168.1.1

Mcli Run Boot /p deviceMac=00-00-00-00-00-11

Mcli SetupConnection /p server=192.168.1.1

Mcli Run Boot /p deviceMac=00-00-00-00-00-11

Mcli Run Boot /p deviceMac=00-00-00-00-00-22

Mcli Run Boot /p deviceMac=00-00-00-00-00-33

Mcli Run Boot /p deviceMac=00-00-00-00-00-44

Mcli Run Boot /p siteName=Boston collectionName=Sales

A sample batch file to check for vDisk updates:

Mcli SetupConnection /p server=192.168.1.1

Mcli Run ApplyAutoUpdate /p siteName=Boston

Note: When configuring the server connection using the Mcli-Run SetupConnection command, do not specify the user, password, or domain as these values will not be protected in the batch file/script.

To create a script, complete either the Windows 2008 R2 Task Scheduler procedure or the Windows 2003 R2 Task Scheduler procedure.

Creating an Update Task Using Windows 2008 R2 Task Scheduler

  1. Start the Task Scheduler from the Start Menu (Start>All Programs>Accessories>System Tools>Task Scheduler). The Task Scheduler dialog appears.
  2. From the Action menu, select the Create Task... menu option. The Create Task dialog appears.
  3. On the General tab, type a name and a description to associate with this task.
  4. If necessary, click Change User or Group... to select a different user to run the batch file/script.
  5. Select the Run whether user is loggon on or not radio button.
  6. On the Triggers tab, click New... to begin creating a schedule for this task.
  7. Select how this task should begin from the Begin the task: drop-down list.
  8. Select how often to perform this task by enabling the radio button next to the appropriate option.
  9. Enter or scroll to set the start date and the time of day this task should run.
  10. Optionally, enable or disable any advanced settings.
  11. Click OK to close the dialog.
  12. On the Actions tab, click New.... The New Action dialog appears.
  13. From the Action drop-down menu, select the action that this task will perform.
  14. In the Program/script: text box, type or browse for the name of the batch file/script, then click OK.
  15. Optionally, configure additional task configuration settings on the Conditions and Settings tabs.
  16. Click OK to close the dialog.
  17. If prompted, enter the password for the user running the file/script, then click OK to close the dialog.
  18. In the Task Scheduler window, select the Task Scheduler Library node in the left pane tree. The new task should appear in the center pane of the window.

Creating an Update Task Using Windows 2003 R2 Task Scheduler

  1. Start the Task Scheduler for the Start Menu (Start>All Programs>Accessories>System Tools>Scheduled Tasks). The Scheduled Tasks dialog appears.
  2. Click Add Scheduled Task. The Scheduled Task Wizard appears.
  3. Click Next to continue.
  4. Click Browse... then select the program to use to run the batch file/script.
  5. Click Next, then enter a name for the task.
    Note: This name can be the same name as the program previously chosen to run the batch file/script.
  6. Select when to perform this task by enabling the radio button next to the appropriate option, then click Next.
  7. Under Start time:, enter or scroll to set the time of day this task should run.
  8. Under Perform this task:, select the radio button next to the appropriate day criteria.
  9. Under Start date:, select the starting date for this task. then click Next.
  10. Enter the credentials for the user that will execute the task, then click Next.
  11. The confirmation page displays with a task configuration summary. After reviewing configuration settings, click Finish to complete the creation of this task.