Share via


Schedules

 

Updated: May 13, 2016

Applies To: Windows Azure Pack for Windows Server, System Center 2012 R2 Orchestrator

Automation Schedules are used to schedule runbooks to run automatically. This could be either a single date and time for the runbook to run once. Or it could be a recurring schedule to start the runbook multiple times. Schedules are typically not accessed from runbooks.

Windows PowerShell Cmdlets

The cmdlets in the following table are used to create and manage variables with Windows PowerShell in Service Management Automation.

Cmdlets Description
Get-SmaSchedule Retrieves a schedule.
Set-SmaSchedule Creates a new schedule or sets the properties for an existing schedule.

Creating a new Schedule

To create a new schedule with the management portal

  1. Select the Automation workspace.

  2. At the top of the window, click Assets.

  3. At the bottom of the window, click Add Setting.

  4. Click Add Schedule.

  5. Type a name for the variable in the Name box.

  6. Click the right arrow.

  7. Select One Time or Daily.

  8. Select a Start Time.

  9. For a Daily schedule, perform the following steps:

    1. If the schedule should not run indefinitely, select Schedule Expires On and specify an expiration date and time.

    2. In the Recur Every box, select the number of days the schedule should recur.

  10. Click the check mark to save the variable.

To create a new schedule with Windows PowerShell in Service Management Automation

TheSet-SmaSchedule cmdlet both creates a new schedule and sets the value for an existing schedule. The following sample Windows PowerShell commands create a new schedule called My Daily Schedule that starts on the current day and fires every day at noon for one year:

$web = 'https://MySMAServer'  
$port = 9090  
$scheduleName = 'My Daily Schedule'  
$startTime = (Get-Date).Date.AddHours(12)  
$expiryTime = $startTime.AddYears(1)  
Set-SmaSchedule –WebServiceEndpoint $web –Port $port –Name $scheduleName –ScheduleType OneTimeSchedule –StartTime $startTime –ExpiryTime $expiryTime –DayInterval 1  

See Also

Service Management Automation
Authoring Automation Runbooks
Global Assets
Scheduling a Runbook