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
Select the Automation workspace.
At the top of the window, click Assets.
At the bottom of the window, click Add Setting.
Click Add Schedule.
Type a name for the variable in the Name box.
Click the right arrow.
Select One Time or Daily.
Select a Start Time.
For a Daily schedule, perform the following steps:
If the schedule should not run indefinitely, select Schedule Expires On and specify an expiration date and time.
In the Recur Every box, select the number of days the schedule should recur.
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