New-CsOnlineSchedule

Use the New-CsOnlineSchedule cmdlet to create a new schedule.

Syntax

New-CsOnlineSchedule
   -Name <String>
   -WeeklyRecurrentSchedule
   [-MondayHours <List>]
   [-TuesdayHours <List>]
   [-WednesdayHours <List>]
   [-ThursdayHours <List>]
   [-FridayHours <List>]
   [-SaturdayHours <List>]
   [-SundayHours <List>]
   [-Complement]
   [-Tenant <Guid>]
   [<CommonParameters>]
New-CsOnlineSchedule
   -Name <String>
   -FixedSchedule
   [-DateTimeRanges <List>]
   [-Tenant <Guid>]
   [<CommonParameters>]

Description

The New-CsOnlineSchedule cmdlet creates a new schedule for the Auto Attendant (AA) service. The AA service uses schedules to conditionally execute call flows when a specific schedule is in effect.

NOTES:

  • The type of the schedule cannot be altered after the schedule is created.
  • Currently, only two types of schedules can be created: WeeklyRecurrentSchedule or FixedSchedule.
  • The schedule types are mutually exclusive. So a weekly recurrent schedule cannot be a fixed schedule and vice versa.
  • For a weekly recurrent schedule, at least one day should have time ranges specified.
  • You can create a new time range by using New-CsOnlineTimeRange cmdlet.
  • A fixed schedule can be created without any date-time ranges. In this case, it would never be in effect.
  • For a fixed schedule, at most 10 date-time ranges can be specified.
  • You can create a new date-time range for a fixed schedule by using the New-CsOnlineDateTimeRange cmdlet.
  • The return type of this cmdlet composes a member for the underlying type/implementation. For example, in case of the weekly recurrent schedule, you can modify Monday's time ranges through the Schedule.WeeklyRecurrentSchedule.MondayHours property. Similarly, date-time ranges of a fixed schedule can be modified by using the Schedule.FixedSchedule.DateTimeRanges property.
  • Schedules can then be used by New-CsAutoAttendantCallHandlingAssociation.

Examples

-------------------------- Example 1 --------------------------

$tr1 = New-CsOnlineTimeRange -Start 09:00 -End 12:00
$tr2 = New-CsOnlineTimeRange -Start 13:00 -End 17:00
$businessHours = New-CsOnlineSchedule -Name "Business Hours" -WeeklyRecurrentSchedule -MondayHours @($tr1, $tr2) -TuesdayHours @($tr1, $tr2) -WednesdayHours @($tr1, $tr2) -ThursdayHours @($tr1, $tr2) -FridayHours @($tr1, $tr2)

This example creates a weekly recurrent schedule that is active on Monday-Friday from 9AM-12PM and 1PM-5PM.

-------------------------- Example 2 --------------------------

$tr1 = New-CsOnlineTimeRange -Start 09:00 -End 12:00
$tr2 = New-CsOnlineTimeRange -Start 13:00 -End 17:00
$afterHours = New-CsOnlineSchedule -Name " After Hours" -WeeklyRecurrentSchedule -MondayHours @($tr1, $tr2) -TuesdayHours @($tr1, $tr2) -WednesdayHours @($tr1, $tr2) -ThursdayHours @($tr1, $tr2) -FridayHours @($tr1, $tr2) -Complement

This example creates a weekly recurrent schedule that is active at all times except Monday-Friday, 9AM-12PM and 1PM-5PM.

-------------------------- Example 3 --------------------------

$dtr = New-CsOnlineDateTimeRange -Start "24/12/2017" -End "26/12/2017"
$christmasSchedule = New-CsOnlineSchedule -Name "Christmas" -FixedSchedule -DateTimeRanges @($dtr)

This example creates a fixed schedule that is active from December 24, 2017 to December 26, 2017.

-------------------------- Example 4 --------------------------

$dtr1 = New-CsOnlineDateTimeRange -Start "24/12/2017" -End "26/12/2017"
$dtr2 = New-CsOnlineDateTimeRange -Start "24/12/2018" -End "26/12/2018"
$christmasSchedule = New-CsOnlineSchedule -Name "Christmas" -FixedSchedule -DateTimeRanges @($dtr1, $dtr2)

This example creates a fixed schedule that is active from December 24, 2017 to December 26, 2017 and then from December 24, 2018 to December 26, 2018.

-------------------------- Example 5 --------------------------

$notInEffectSchedule = New-CsOnlineSchedule -Name "NotInEffect" -FixedSchedule

This example creates a fixed schedule that is never active.

Parameters

-Complement

The Complement parameter indicates how the schedule is used. When Complement is enabled, the schedule is used as the inverse of the provided configuration. For example, if Complement is enabled and the schedule only contains time ranges of Monday to Friday from 9AM to 5PM, then the schedule is active at all times other than the specified time ranges.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-DateTimeRanges

List of date-time ranges for a fixed schedule. At most, 10 date-time ranges can be specified using this parameter.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-FixedSchedule

The FixedSchedule parameter indicates that a fixed schedule is to be created.

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

-FridayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-MondayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-Name

The Name parameter represents a unique friendly name for the schedule.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-SaturdayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-SundayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-Tenant

Type:System.Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-ThursdayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-TuesdayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-WednesdayHours

List of time ranges for that day.

Type:System.Collections.Generic.List
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Microsoft Teams

-WeeklyRecurrentSchedule

The WeeklyRecurrentSchedule parameter indicates that a weekly recurrent schedule is to be created. This parameter is mandatory when a weekly recurrent schedule is to be created.

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

Inputs

None

Outputs

Microsoft.Rtc.Management.Hosted.Online.Models.Schedule