Automating tasks

You can automate a workload by entering Windows PowerShell cmdlets or command-line interface commands in the integrated command line.

About this task

You use the Automate view to work with commands. You can create, save, store, and schedule commands to run at the scheduled time.

Procedure

  1. To open the Automate view, select a workload that you want to work with and click Automate. An integrated command line is available in the task window from which you can enter PowerShell cmdlets or command-line interface commands.
  2. Change PowerShell to Command Line.
  3. To run a command, type a command in the details pane and click the Execute icon. You can issue the commands with or without specifying tdpsqlc.
    For example, for each selected workload instance, you can enter a single command or multiple commands, such as:
    q tsm
    q sql 

    You can also run a saved task by clicking the Open icon, selecting the command file, and clicking the Execute icon.

    The output is displayed in the main window.
  4. Click the Save icon and follow the prompts to save a command for future use.
  5. To schedule a command, click the Schedule this command icon to open the scheduling wizard. Follow the prompts in the wizard to create a schedule for the command. The output of the command is displayed in the results pane.
  6. (Optional) Save or send the command output to an email address.

What to do next

You can automate commands from the Protect, Recover, Schedule, and Task List views in Microsoft Management Console (MMC):
  1. Start MMC and select the SQL Server instance in the navigation tree.
  2. Click the tab for the task you want to do (Protect or Recover).
  3. Automate the command by using one of the following methods:
    Result pane
    Select the item for your task in the result pane, and select Run Scheduled in the toolbar menu. Click the appropriate task in the Action pane. When the schedule wizard starts, enter the information for each prompt to create a scheduled task.
    Task List pane
    When a task is submitted, it displays in the task list pane. Select the appropriate task, then click Schedule command script in the task list toolbar. When the schedule wizard starts, enter the information for each prompt to create a scheduled task.

    You can also right-click a task in the Task List pane and click Copy. Then, click the Automate tab and paste the command in the field.