Edit

Share via


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

ByDaily (Default)

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

ByOneTime

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

ByHourly

New-AzureAutomationSchedule
    -Name <String>
    -StartTime <DateTimeOffset>
    -HourInterval <Byte>
    -AutomationAccountName <String>
    [-Description <String>]
    [-ExpiryTime <DateTimeOffset>]
    [-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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DayInterval

Specifies an interval, in days, for the schedule.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDaily
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies a description.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ExpiryTime

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

Parameter properties

Type:DateTimeOffset
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDaily
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByHourly
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HourInterval

Specifies an interval, in hours, for the schedule.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByHourly
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies a name for the schedule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-OneTime

Indicates that this operation creates a one-time schedule.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByOneTime
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:AzureSMProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StartTime

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

Parameter properties

Type:DateTimeOffset
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Schedule