New-AzureAutomationSchedule

Creates an Automation schedule.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

New-AzureAutomationSchedule
   -Name <String>
   -StartTime <DateTimeOffset>
   [-Description <String>]
   [-ExpiryTime <DateTimeOffset>]
   -DayInterval <Byte>
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
New-AzureAutomationSchedule
   -Name <String>
   -StartTime <DateTimeOffset>
   [-Description <String>]
   [-OneTime]
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
New-AzureAutomationSchedule
   -Name <String>
   -StartTime <DateTimeOffset>
   [-Description <String>]
   [-ExpiryTime <DateTimeOffset>]
   -HourInterval <Byte>
   -AutomationAccountName <String>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

Important

This PowerShell command for Azure Automation is longer supported as of 01/23/2020. The Azure Service Management model is deprecated for Azure Automation and was disabled on that date. Please use the commands which support the Azure Resource Management model in Az.Automation.

The New-AzureAutomationSchedule cmdlet creates a schedule in Microsoft Azure Automation.

Examples

Example 1: Create a one-time schedule

PS C:\> New-AzureAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -StartTime "23:00" -OneTime

The following command creates a schedule that runs one time on the current date at 11:00 PM.

Example 2: Create a recurring schedule

PS C:\> $StartTime = Get-Date "13:00:00"
PS C:\> $EndTime = $StartTime.AddYears(1)
PS C:\> New-AzureAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule02" -StartTime $StartTime -ExpiryTime $EndTime -DailyInterval 1

The following commands create a new schedule that runs at 1:00 PM every day for one year starting on the current day.

Parameters

-AutomationAccountName

Specifies the name of an Automation account.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DayInterval

Specifies an interval, in days, for the schedule.

Type:Byte
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ExpiryTime

Specifies the expiry time of a schedule. A string can be provided if it can be converted to a valid DateTime.

Type:DateTimeOffset
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HourInterval

Specifies an interval, in hours, for the schedule.

Type:Byte
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies a name for the schedule.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OneTime

Indicates that this operation creates a one-time schedule.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StartTime

Specifies the start time of a schedule. A string can be provided if it can be converted to a valid DateTime.

Type:DateTimeOffset
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Schedule