< Back

New-AzureRmAutomationSchedule

Tue Jan 29, 2019 9:32 pm

NAME New-AzureRmAutomationSchedule



SYNOPSIS

Creates an Automation schedule.





SYNTAX

New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

-DayInterval <Byte> [-DefaultProfile <IAzureContextContainer>] [-Description <String>] [-ExpiryTime <DateTimeOffset>] [-TimeZone <String>]

[<CommonParameters>]



New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

[-DayOfWeek {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-DayOfWeekOccurrence {First | Second | Third | Fourth |

Last}] [-DefaultProfile <IAzureContextContainer>] [-Description <String>] [-ExpiryTime <DateTimeOffset>] -MonthInterval <Byte> [-TimeZone

<String>] [<CommonParameters>]



New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

[-DaysOfMonth {One | Two | Three | Four | Five | Six | Seventh | Eighth | Ninth | Tenth | Eleventh | Twelfth | Thirteenth | Fourteenth | Fifteenth

| Sixteenth | Seventeenth | Eighteenth | Nineteenth | Twentieth | TwentyFirst | TwentySecond | TwentyThird | TwentyFourth | TwentyFifth |

TwentySixth | TwentySeventh | TwentyEighth | TwentyNinth | Thirtieth | ThirtyFirst | LastDay}] [-DefaultProfile <IAzureContextContainer>]

[-Description <String>] [-ExpiryTime <DateTimeOffset>] -MonthInterval <Byte> [-TimeZone <String>] [<CommonParameters>]



New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

[-DaysOfWeek {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-DefaultProfile <IAzureContextContainer>] [-Description

<String>] [-ExpiryTime <DateTimeOffset>] [-TimeZone <String>] -WeekInterval <Byte> [<CommonParameters>]



New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

[-DefaultProfile <IAzureContextContainer>] [-Description <String>] [-ExpiryTime <DateTimeOffset>] -HourInterval <Byte> [-TimeZone <String>]

[<CommonParameters>]



New-AzureRmAutomationSchedule [-ResourceGroupName] <String> [-AutomationAccountName] <String> [-Name] <String> [-StartTime] <DateTimeOffset>

[-DefaultProfile <IAzureContextContainer>] [-Description <String>] -OneTime [-TimeZone <String>] [<CommonParameters>]





DESCRIPTION

The New-AzureRmAutomationSchedule cmdlet creates a schedule in Azure Automation.





PARAMETERS

-AutomationAccountName <String>

Specifies the name of an Automation account for which this cmdlet creates a schedule.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DayInterval <Byte>

Specifies an interval, in days, for the schedule. If you do not specify this parameter, and you do not specify the OneTime parameter, the

default value is one (1).



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DayOfWeek <DayOfWeek>

Specifies a list of days of the week for the weekly schedule.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DayOfWeekOccurrence <DayOfWeekOccurrence>

Specifies the occurrence of the week within the month that the schedule runs. psdx_paramvalues



- 1



- 2



- 3



- 4



- -1



- First



- Second



- Third



- Fourth



- LastDay



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DaysOfMonth <DaysOfMonth[]>

Specifies a list of days of the month for the monthly schedule.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DaysOfWeek <DayOfWeek[]>

Specifies a list of days of the week for the weekly schedule.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

Specifies a description for the schedule.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ExpiryTime <DateTimeOffset>

Specifies the expiry time of a schedule as a DateTimeOffest object. You can specify a string that can be converted to a valid DateTimeOffset .



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HourInterval <Byte>

Specifies an interval, in hours, for the schedule.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MonthInterval <Byte>

Specifies an interval, in Months, for the schedule.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a name for the schedule.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-OneTime [<SwitchParameter>]

Specifies that the cmdlet creates a one-time schedule.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of a resource group for which this cmdlet creates a schedule.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StartTime <DateTimeOffset>

Specifies the start time of a schedule as a DateTimeOffset object. You can specify a string that can be converted to a valid DateTimeOffset .

. If the TimeZone parameter is specified, the offset will be ignored and the time zone specified is used.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-TimeZone <String>

Specifies the time zone for the schedule. This string can be the IANA ID or the Windows Time Zone ID.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WeekInterval <Byte>

Specifies an interval, in weeks, for the schedule.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Automation.Model.Schedule







NOTES









Example 1: Create a one-time schedule in local time



PS C:\\>$TimeZone = ([System.TimeZoneInfo]::Local)Id

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

"ResourceGroup01" -TimeZone $TimeZone



The first command gets the time zone ID from the system and stores it in the $TimeZone variable. The second command creates a schedule that runs

one time on the current date at 11:00 PM in the specified time zone..





Example 2: Create a recurring schedule



PS C:\\>$StartTime = Get-Date "13:00:00"

PS C:\\> $EndTime = $StartTime.AddYears(1)

PS C:\\> New-AzureRmAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule02" -StartTime $StartTime -ExpiryTime $EndTime

-DailyInterval 1 -ResourceGroupName "ResourceGroup01"



The first command creates a date object by using the Get-Date cmdlet, and then stores the object in the $StartDate variable. Specify a time that

is at least five minutes in the future.



The second command creates a date object by using the Get-Date cmdlet, and then stores the object in the $EndDate variable. The command specifies

a future time.



The final command creates a daily schedule named Schedule01 to begin at the time stored in $StartDate and expire at the time stored in $EndDate.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... onschedule

Get-AzureRmAutomationSchedule

Remove-AzureRmAutomationSchedule

Set-AzureRmAutomationSchedule