Edit

Share via


New-CMSchedule

Create a Configuration Manager schedule token.

Syntax

RecurrenceNone (Default)

New-CMSchedule
    [-IsUtc]
    [-Nonrecurring]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceMonthlyByDate

New-CMSchedule
    -DayOfMonth <Int32>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceMonthlyByDateWithDuration

New-CMSchedule
    -DayOfMonth <Int32>
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceMonthlyByDateWithEnd

New-CMSchedule
    -DayOfMonth <Int32>
    -End <DateTime>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceWeekly

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceWeeklyWithDuration

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceWeeklyWithEnd

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    -End <DateTime>
    [-IsUtc]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyByWeekday

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    -WeekOrder <ScheduleWeekOrder>
    [-IsUtc]
    [-OffsetDay <Int32>]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyByWeekdayWithDuration

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    -WeekOrder <ScheduleWeekOrder>
    [-IsUtc]
    [-OffsetDay <Int32>]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyByWeekdayWithEnd

New-CMSchedule
    -DayOfWeek <DayOfWeek>
    -End <DateTime>
    -WeekOrder <ScheduleWeekOrder>
    [-IsUtc]
    [-OffsetDay <Int32>]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceNoneWithDuration

New-CMSchedule
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    [-IsUtc]
    [-Nonrecurring]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyLastDayOfMonthWithDuration

New-CMSchedule
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    [-IsUtc]
    [-LastDayOfMonth]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceIntervalWithDuration

New-CMSchedule
    -DurationCount <Int32>
    -DurationInterval <ScheduleInterval>
    -RecurCount <Int32>
    -RecurInterval <ScheduleInterval>
    [-IsUtc]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceNoneWithEnd

New-CMSchedule
    -End <DateTime>
    [-IsUtc]
    [-Nonrecurring]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyLastDayOfMonthWithEnd

New-CMSchedule
    -End <DateTime>
    [-IsUtc]
    [-LastDayOfMonth]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceIntervalWithEnd

New-CMSchedule
    -End <DateTime>
    -RecurCount <Int32>
    -RecurInterval <ScheduleInterval>
    [-IsUtc]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurMonthlyLastDayOfMonth

New-CMSchedule
    [-IsUtc]
    [-LastDayOfMonth]
    [-RecurCount <Int32>]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RecurrenceInterval

New-CMSchedule
    -RecurCount <Int32>
    -RecurInterval <ScheduleInterval>
    [-IsUtc]
    [-ScheduleString]
    [-Start <DateTime>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-CMSchedule cmdlet creates a schedule token in Configuration Manager. Create schedule tokens to schedule events with differing frequencies such as daily, weekly, and monthly.

To decode and encode schedule tokens into and from an interval string, use the Convert-CMSchedule cmdlet. You can then use the interval strings to set schedule properties when you define or modify Configuration Manager objects.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Create a schedule token

This command creates a schedule token that specifies that the event occurs on the last day of the month at the specified date and time (Wednesday, August 5, 2020 17:46:03 Pacific Daylight Time).

$schedToken1 = New-CMSchedule -DayOfMonth 0 -Start "2020-08-05T17:46:03.7236084-07:00"

Example 2: Create an offset schedule

The following example creates the following schedule:

  • Starts on the current date
  • On the second Monday of the month
  • Recurs once
$schedToken2 = New-CMSchedule -Start (Get-Date) -DayOfWeek Monday -WeekOrder Second -RecurCount 1 -OffsetDay 0

Example 3: Create a schedule to run daily

This example creates a simple schedule that occurs daily forever. You can use this type of schedule when you deploy a configuration baseline.

New-CMSchedule -DurationInterval Days -DurationCount 0 -RecurInterval Days -RecurCount 1

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

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

-DayOfMonth

Specifies the day of the month when the event occurs. Valid values range from 0 through 31. The default value is 0, which indicates the last day of the month.

Parameter properties

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

Parameter sets

RecurrenceMonthlyByDate
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceMonthlyByDateWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceMonthlyByDateWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DayOfWeek

Specifies the day of the week when the event occurs.

Parameter properties

Type:DayOfWeek
Default value:None
Accepted values:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Supports wildcards:False
DontShow:False

Parameter sets

RecurrenceWeekly
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekday
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
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

-DurationCount

Specifies the number of days during which the scheduled event occurs. Valid values range from 0 through 31. The default value is 0, which indicates that the scheduled action continues indefinitely.

Parameter properties

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

Parameter sets

RecurrenceMonthlyByDateWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceNoneWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceIntervalWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DurationInterval

Specifies the time when the event occurs.

Parameter properties

Type:ScheduleInterval
Default value:None
Accepted values:Minutes, Hours, Days
Supports wildcards:False
DontShow:False

Parameter sets

RecurrenceMonthlyByDateWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceNoneWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceIntervalWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-End

Specifies the date and time when the scheduled event ends.

Parameter properties

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

Parameter sets

RecurrenceMonthlyByDateWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceNoneWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceIntervalWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
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

-IsUtc

Indicates that the time is Coordinated Universal Time (UTC).

Parameter properties

Type:SwitchParameter
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

-LastDayOfMonth

Indicates that the event occurs monthly on the last day of the month.

Parameter properties

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

Parameter sets

RecurMonthlyLastDayOfMonthWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonth
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Nonrecurring

Indicates that the scheduled event doesn't recur.

Parameter properties

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

Parameter sets

RecurrenceNone
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceNoneWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceNoneWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OffsetDay

Use this parameter to configure an offset such as monthly by weekday. The range for parameter OffsetDays is 7 days.

Parameter properties

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

Parameter sets

RecurMonthlyByWeekday
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithEnd
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecurCount

Specifies the number of recurrences of the scheduled event.

Parameter properties

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

Parameter sets

RecurrenceMonthlyByDate
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceMonthlyByDateWithDuration
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceMonthlyByDateWithEnd
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeekly
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithDuration
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceWeeklyWithEnd
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekday
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithEnd
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithDuration
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonthWithEnd
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyLastDayOfMonth
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecurInterval

Specifies the time when the scheduled event recurs.

Parameter properties

Type:ScheduleInterval
Default value:None
Accepted values:Minutes, Hours, Days
Supports wildcards:False
DontShow:False

Parameter sets

RecurrenceIntervalWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceIntervalWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurrenceInterval
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ScheduleString

Indicates that the schedule token is converted to an interval string.

Parameter properties

Type:SwitchParameter
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

-Start

Specifies the date and time when the scheduled event occurs.

Parameter properties

Type:DateTime
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

-WeekOrder

Specifies the week of the month when the event occurs. The default value is Last (0).

Parameter properties

Type:ScheduleWeekOrder
Default value:None
Accepted values:Last, First, Second, Third, Fourth
Supports wildcards:False
DontShow:False

Parameter sets

RecurMonthlyByWeekday
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithDuration
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
RecurMonthlyByWeekdayWithEnd
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
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.

Inputs

None

Outputs

IResultObject

System.String